diff --git a/Plan/src/main/java/com/djrapitops/plan/Plan.java b/Plan/src/main/java/com/djrapitops/plan/Plan.java index 2d8ade1ec..0daa33c33 100644 --- a/Plan/src/main/java/com/djrapitops/plan/Plan.java +++ b/Plan/src/main/java/com/djrapitops/plan/Plan.java @@ -21,13 +21,6 @@ package com.djrapitops.plan; import com.djrapitops.plan.api.exceptions.EnableException; import com.djrapitops.plan.command.PlanCommand; -import com.djrapitops.plan.modules.APFModule; -import com.djrapitops.plan.modules.FilesModule; -import com.djrapitops.plan.modules.SuperClassBindingModule; -import com.djrapitops.plan.modules.SystemObjectBindingModule; -import com.djrapitops.plan.modules.server.ServerSuperClassBindingModule; -import com.djrapitops.plan.modules.server.bukkit.BukkitServerPropertiesModule; -import com.djrapitops.plan.modules.server.bukkit.BukkitSuperClassBindingModule; import com.djrapitops.plan.system.PlanSystem; import com.djrapitops.plan.system.locale.Locale; import com.djrapitops.plan.system.locale.lang.PluginLang; @@ -36,62 +29,11 @@ import com.djrapitops.plan.utilities.metrics.BStatsBukkit; import com.djrapitops.plugin.BukkitPlugin; import com.djrapitops.plugin.benchmarking.Benchmark; import com.djrapitops.plugin.command.ColorScheme; -import com.djrapitops.plugin.command.CommandNode; -import dagger.BindsInstance; -import dagger.Component; -import dagger.Module; -import dagger.Provides; import org.bukkit.configuration.file.FileConfiguration; -import javax.inject.Named; -import javax.inject.Singleton; import java.util.logging.Level; import java.util.logging.Logger; -@Singleton -@Component(modules = { - BukkitPlanModule.class, - SuperClassBindingModule.class, - SystemObjectBindingModule.class, - APFModule.class, - FilesModule.class, - BukkitServerPropertiesModule.class, - ServerSuperClassBindingModule.class, - BukkitSuperClassBindingModule.class -}) -interface PlanComponent { - - PlanCommand planCommand(); - - PlanSystem system(); - - @Component.Builder - interface Builder { - - @BindsInstance - Builder plan(Plan plan); - - PlanComponent build(); - } -} - -@Module -class BukkitPlanModule { - - @Provides - @Singleton - PlanPlugin providePlanPlugin(Plan plugin) { - return plugin; - } - - @Provides - @Singleton - @Named("mainCommand") - CommandNode provideMainCommand(PlanCommand command) { - return command; - } -} - /** * Main class for Bukkit that manages the plugin. * @@ -105,7 +47,7 @@ public class Plan extends BukkitPlugin implements PlanPlugin { @Override public void onEnable() { - PlanComponent component = DaggerPlanComponent.builder().plan(this).build(); + PlanBukkitComponent component = DaggerPlanBukkitComponent.builder().plan(this).build(); try { timings.start("Enable"); system = component.system(); diff --git a/Plan/src/main/java/com/djrapitops/plan/PlanBukkitComponent.java b/Plan/src/main/java/com/djrapitops/plan/PlanBukkitComponent.java new file mode 100644 index 000000000..44aabd683 --- /dev/null +++ b/Plan/src/main/java/com/djrapitops/plan/PlanBukkitComponent.java @@ -0,0 +1,44 @@ +package com.djrapitops.plan; + +import com.djrapitops.plan.command.PlanCommand; +import com.djrapitops.plan.modules.*; +import com.djrapitops.plan.modules.server.ServerSuperClassBindingModule; +import com.djrapitops.plan.modules.server.bukkit.BukkitServerPropertiesModule; +import com.djrapitops.plan.modules.server.bukkit.BukkitSuperClassBindingModule; +import com.djrapitops.plan.system.PlanSystem; +import dagger.BindsInstance; +import dagger.Component; + +import javax.inject.Singleton; + +/** + * Dagger Component that constructs the plugin systems running on Bukkit. + * + * @author Rsl1122 + */ +@Singleton +@Component(modules = { + BukkitPlanModule.class, + SuperClassBindingModule.class, + SystemObjectBindingModule.class, + APFModule.class, + FilesModule.class, + BukkitServerPropertiesModule.class, + ServerSuperClassBindingModule.class, + BukkitSuperClassBindingModule.class +}) +public interface PlanBukkitComponent { + + PlanCommand planCommand(); + + PlanSystem system(); + + @Component.Builder + interface Builder { + + @BindsInstance + Builder plan(Plan plan); + + PlanBukkitComponent build(); + } +} \ No newline at end of file diff --git a/Plan/src/main/java/com/djrapitops/plan/PlanBungee.java b/Plan/src/main/java/com/djrapitops/plan/PlanBungee.java index 31d61a98b..b9e45c8b6 100644 --- a/Plan/src/main/java/com/djrapitops/plan/PlanBungee.java +++ b/Plan/src/main/java/com/djrapitops/plan/PlanBungee.java @@ -6,13 +6,6 @@ package com.djrapitops.plan; import com.djrapitops.plan.api.exceptions.EnableException; import com.djrapitops.plan.command.PlanBungeeCommand; -import com.djrapitops.plan.modules.APFModule; -import com.djrapitops.plan.modules.FilesModule; -import com.djrapitops.plan.modules.SuperClassBindingModule; -import com.djrapitops.plan.modules.SystemObjectBindingModule; -import com.djrapitops.plan.modules.proxy.ProxySuperClassBindingModule; -import com.djrapitops.plan.modules.proxy.bungee.BungeeServerPropertiesModule; -import com.djrapitops.plan.modules.proxy.bungee.BungeeSuperClassBindingModule; import com.djrapitops.plan.system.PlanSystem; import com.djrapitops.plan.system.locale.Locale; import com.djrapitops.plan.system.locale.lang.PluginLang; @@ -20,61 +13,10 @@ import com.djrapitops.plan.system.settings.theme.PlanColorScheme; import com.djrapitops.plan.utilities.metrics.BStatsBungee; import com.djrapitops.plugin.BungeePlugin; import com.djrapitops.plugin.command.ColorScheme; -import com.djrapitops.plugin.command.CommandNode; import com.djrapitops.plugin.logging.L; -import dagger.BindsInstance; -import dagger.Component; -import dagger.Module; -import dagger.Provides; -import javax.inject.Named; -import javax.inject.Singleton; import java.io.InputStream; -@Singleton -@Component(modules = { - BungeePlanModule.class, - SuperClassBindingModule.class, - SystemObjectBindingModule.class, - APFModule.class, - FilesModule.class, - ProxySuperClassBindingModule.class, - BungeeSuperClassBindingModule.class, - BungeeServerPropertiesModule.class -}) -interface PlanBungeeComponent { - - PlanBungeeCommand planCommand(); - - PlanSystem system(); - - @Component.Builder - interface Builder { - - @BindsInstance - Builder plan(PlanBungee plan); - - PlanBungeeComponent build(); - } -} - -@Module -class BungeePlanModule { - - @Provides - @Singleton - PlanPlugin providePlanPlugin(PlanBungee plugin) { - return plugin; - } - - @Provides - @Singleton - @Named("mainCommand") - CommandNode provideMainCommand(PlanBungeeCommand command) { - return command; - } -} - /** * Bungee Main class. * diff --git a/Plan/src/main/java/com/djrapitops/plan/PlanBungeeComponent.java b/Plan/src/main/java/com/djrapitops/plan/PlanBungeeComponent.java new file mode 100644 index 000000000..d9fe39784 --- /dev/null +++ b/Plan/src/main/java/com/djrapitops/plan/PlanBungeeComponent.java @@ -0,0 +1,44 @@ +package com.djrapitops.plan; + +import com.djrapitops.plan.command.PlanBungeeCommand; +import com.djrapitops.plan.modules.*; +import com.djrapitops.plan.modules.proxy.ProxySuperClassBindingModule; +import com.djrapitops.plan.modules.proxy.bungee.BungeeServerPropertiesModule; +import com.djrapitops.plan.modules.proxy.bungee.BungeeSuperClassBindingModule; +import com.djrapitops.plan.system.PlanSystem; +import dagger.BindsInstance; +import dagger.Component; + +import javax.inject.Singleton; + +/** + * Dagger Component that constructs the plugin systems running on Bungee. + * + * @author Rsl1122 + */ +@Singleton +@Component(modules = { + BungeePlanModule.class, + SuperClassBindingModule.class, + SystemObjectBindingModule.class, + APFModule.class, + FilesModule.class, + ProxySuperClassBindingModule.class, + BungeeSuperClassBindingModule.class, + BungeeServerPropertiesModule.class +}) +public interface PlanBungeeComponent { + + PlanBungeeCommand planCommand(); + + PlanSystem system(); + + @Component.Builder + interface Builder { + + @BindsInstance + Builder plan(PlanBungee plan); + + PlanBungeeComponent build(); + } +} \ No newline at end of file diff --git a/Plan/src/main/java/com/djrapitops/plan/PlanSponge.java b/Plan/src/main/java/com/djrapitops/plan/PlanSponge.java index 7afba1c4a..bdedee887 100644 --- a/Plan/src/main/java/com/djrapitops/plan/PlanSponge.java +++ b/Plan/src/main/java/com/djrapitops/plan/PlanSponge.java @@ -2,13 +2,6 @@ package com.djrapitops.plan; import com.djrapitops.plan.api.exceptions.EnableException; import com.djrapitops.plan.command.PlanCommand; -import com.djrapitops.plan.modules.APFModule; -import com.djrapitops.plan.modules.FilesModule; -import com.djrapitops.plan.modules.SuperClassBindingModule; -import com.djrapitops.plan.modules.SystemObjectBindingModule; -import com.djrapitops.plan.modules.server.ServerSuperClassBindingModule; -import com.djrapitops.plan.modules.server.sponge.SpongeServerPropertiesModule; -import com.djrapitops.plan.modules.server.sponge.SpongeSuperClassBindingModule; import com.djrapitops.plan.system.PlanSystem; import com.djrapitops.plan.system.locale.Locale; import com.djrapitops.plan.system.locale.lang.PluginLang; @@ -16,12 +9,7 @@ import com.djrapitops.plan.system.settings.theme.PlanColorScheme; import com.djrapitops.plan.utilities.metrics.BStatsSponge; import com.djrapitops.plugin.SpongePlugin; import com.djrapitops.plugin.command.ColorScheme; -import com.djrapitops.plugin.command.CommandNode; import com.djrapitops.plugin.logging.L; -import dagger.BindsInstance; -import dagger.Component; -import dagger.Module; -import dagger.Provides; import org.bstats.sponge.Metrics; import org.slf4j.Logger; import org.spongepowered.api.Game; @@ -33,55 +21,9 @@ import org.spongepowered.api.event.game.state.GameStoppingServerEvent; import org.spongepowered.api.plugin.Dependency; import org.spongepowered.api.plugin.Plugin; -import javax.inject.Named; -import javax.inject.Singleton; import java.io.File; import java.io.InputStream; -@Singleton -@Component(modules = { - SpongePlanModule.class, - SuperClassBindingModule.class, - SystemObjectBindingModule.class, - APFModule.class, - FilesModule.class, - ServerSuperClassBindingModule.class, - SpongeSuperClassBindingModule.class, - SpongeServerPropertiesModule.class -}) -interface PlanSpongeComponent { - - PlanCommand planCommand(); - - PlanSystem system(); - - @Component.Builder - interface Builder { - - @BindsInstance - Builder plan(PlanSponge plan); - - PlanSpongeComponent build(); - } -} - -@Module -class SpongePlanModule { - - @Provides - @Singleton - PlanPlugin providePlanPlugin(PlanSponge plugin) { - return plugin; - } - - @Provides - @Singleton - @Named("mainCommand") - CommandNode provideMainCommand(PlanCommand command) { - return command; - } -} - @Plugin( id = "plan", name = "Plan", diff --git a/Plan/src/main/java/com/djrapitops/plan/PlanSpongeComponent.java b/Plan/src/main/java/com/djrapitops/plan/PlanSpongeComponent.java new file mode 100644 index 000000000..75ce701ae --- /dev/null +++ b/Plan/src/main/java/com/djrapitops/plan/PlanSpongeComponent.java @@ -0,0 +1,44 @@ +package com.djrapitops.plan; + +import com.djrapitops.plan.command.PlanCommand; +import com.djrapitops.plan.modules.*; +import com.djrapitops.plan.modules.server.ServerSuperClassBindingModule; +import com.djrapitops.plan.modules.server.sponge.SpongeServerPropertiesModule; +import com.djrapitops.plan.modules.server.sponge.SpongeSuperClassBindingModule; +import com.djrapitops.plan.system.PlanSystem; +import dagger.BindsInstance; +import dagger.Component; + +import javax.inject.Singleton; + +/** + * Dagger Component that constructs the plugin systems running on Sponge. + * + * @author Rsl1122 + */ +@Singleton +@Component(modules = { + SpongePlanModule.class, + SuperClassBindingModule.class, + SystemObjectBindingModule.class, + APFModule.class, + FilesModule.class, + ServerSuperClassBindingModule.class, + SpongeSuperClassBindingModule.class, + SpongeServerPropertiesModule.class +}) +interface PlanSpongeComponent { + + PlanCommand planCommand(); + + PlanSystem system(); + + @Component.Builder + interface Builder { + + @BindsInstance + Builder plan(PlanSponge plan); + + PlanSpongeComponent build(); + } +} \ No newline at end of file diff --git a/Plan/src/main/java/com/djrapitops/plan/PlanVelocity.java b/Plan/src/main/java/com/djrapitops/plan/PlanVelocity.java index 1593a1a7b..a6e8226dd 100644 --- a/Plan/src/main/java/com/djrapitops/plan/PlanVelocity.java +++ b/Plan/src/main/java/com/djrapitops/plan/PlanVelocity.java @@ -6,80 +6,22 @@ package com.djrapitops.plan; import com.djrapitops.plan.api.exceptions.EnableException; import com.djrapitops.plan.command.PlanVelocityCommand; -import com.djrapitops.plan.modules.APFModule; -import com.djrapitops.plan.modules.FilesModule; -import com.djrapitops.plan.modules.SuperClassBindingModule; -import com.djrapitops.plan.modules.SystemObjectBindingModule; -import com.djrapitops.plan.modules.proxy.ProxySuperClassBindingModule; -import com.djrapitops.plan.modules.proxy.velocity.VelocityServerPropertiesModule; -import com.djrapitops.plan.modules.proxy.velocity.VelocitySuperClassBindingModule; import com.djrapitops.plan.system.PlanSystem; import com.djrapitops.plan.system.locale.Locale; import com.djrapitops.plan.system.locale.lang.PluginLang; import com.djrapitops.plan.system.settings.theme.PlanColorScheme; import com.djrapitops.plugin.VelocityPlugin; import com.djrapitops.plugin.command.ColorScheme; -import com.djrapitops.plugin.command.CommandNode; import com.djrapitops.plugin.logging.L; import com.velocitypowered.api.plugin.Plugin; import com.velocitypowered.api.plugin.annotation.DataDirectory; import com.velocitypowered.api.proxy.ProxyServer; -import dagger.BindsInstance; -import dagger.Component; -import dagger.Module; -import dagger.Provides; import org.slf4j.Logger; -import javax.inject.Named; -import javax.inject.Singleton; import java.io.File; import java.io.InputStream; import java.nio.file.Path; -@Singleton -@Component(modules = { - VelocityPlanModule.class, - SuperClassBindingModule.class, - SystemObjectBindingModule.class, - APFModule.class, - FilesModule.class, - ProxySuperClassBindingModule.class, - VelocitySuperClassBindingModule.class, - VelocityServerPropertiesModule.class -}) -interface PlanVelocityComponent { - - PlanVelocityCommand planCommand(); - - PlanSystem system(); - - @Component.Builder - interface Builder { - - @BindsInstance - Builder plan(PlanVelocity plan); - - PlanVelocityComponent build(); - } -} - -@Module -class VelocityPlanModule { - - @Provides - @Singleton - PlanPlugin providePlanPlugin(PlanVelocity plugin) { - return plugin; - } - - @Provides - @Singleton - @Named("mainCommand") - CommandNode provideMainCommand(PlanVelocityCommand command) { - return command; - } -} - /** * Velocity Main class. *
diff --git a/Plan/src/main/java/com/djrapitops/plan/PlanVelocityComponent.java b/Plan/src/main/java/com/djrapitops/plan/PlanVelocityComponent.java new file mode 100644 index 000000000..8d0e6ebf3 --- /dev/null +++ b/Plan/src/main/java/com/djrapitops/plan/PlanVelocityComponent.java @@ -0,0 +1,44 @@ +package com.djrapitops.plan; + +import com.djrapitops.plan.command.PlanVelocityCommand; +import com.djrapitops.plan.modules.*; +import com.djrapitops.plan.modules.proxy.ProxySuperClassBindingModule; +import com.djrapitops.plan.modules.proxy.velocity.VelocityServerPropertiesModule; +import com.djrapitops.plan.modules.proxy.velocity.VelocitySuperClassBindingModule; +import com.djrapitops.plan.system.PlanSystem; +import dagger.BindsInstance; +import dagger.Component; + +import javax.inject.Singleton; + +/** + * Dagger Component that constructs the plugin systems running on Velocity. + * + * @author Rsl1122 + */ +@Singleton +@Component(modules = { + VelocityPlanModule.class, + SuperClassBindingModule.class, + SystemObjectBindingModule.class, + APFModule.class, + FilesModule.class, + ProxySuperClassBindingModule.class, + VelocitySuperClassBindingModule.class, + VelocityServerPropertiesModule.class +}) +interface PlanVelocityComponent { + + PlanVelocityCommand planCommand(); + + PlanSystem system(); + + @Component.Builder + interface Builder { + + @BindsInstance + Builder plan(PlanVelocity plan); + + PlanVelocityComponent build(); + } +} \ No newline at end of file diff --git a/Plan/src/main/java/com/djrapitops/plan/modules/BukkitPlanModule.java b/Plan/src/main/java/com/djrapitops/plan/modules/BukkitPlanModule.java new file mode 100644 index 000000000..48433a5f5 --- /dev/null +++ b/Plan/src/main/java/com/djrapitops/plan/modules/BukkitPlanModule.java @@ -0,0 +1,33 @@ +package com.djrapitops.plan.modules; + +import com.djrapitops.plan.Plan; +import com.djrapitops.plan.PlanPlugin; +import com.djrapitops.plan.command.PlanCommand; +import com.djrapitops.plugin.command.CommandNode; +import dagger.Module; +import dagger.Provides; + +import javax.inject.Named; +import javax.inject.Singleton; + +/** + * Dagger module for binding Plan instance. + * + * @author Rsl1122 + */ +@Module +public class BukkitPlanModule { + + @Provides + @Singleton + PlanPlugin providePlanPlugin(Plan plugin) { + return plugin; + } + + @Provides + @Singleton + @Named("mainCommand") + CommandNode provideMainCommand(PlanCommand command) { + return command; + } +} \ No newline at end of file diff --git a/Plan/src/main/java/com/djrapitops/plan/modules/BungeePlanModule.java b/Plan/src/main/java/com/djrapitops/plan/modules/BungeePlanModule.java new file mode 100644 index 000000000..dc8b7339e --- /dev/null +++ b/Plan/src/main/java/com/djrapitops/plan/modules/BungeePlanModule.java @@ -0,0 +1,33 @@ +package com.djrapitops.plan.modules; + +import com.djrapitops.plan.PlanBungee; +import com.djrapitops.plan.PlanPlugin; +import com.djrapitops.plan.command.PlanBungeeCommand; +import com.djrapitops.plugin.command.CommandNode; +import dagger.Module; +import dagger.Provides; + +import javax.inject.Named; +import javax.inject.Singleton; + +/** + * Dagger module for binding PlanBungee instance. + * + * @author Rsl1122 + */ +@Module +public class BungeePlanModule { + + @Provides + @Singleton + PlanPlugin providePlanPlugin(PlanBungee plugin) { + return plugin; + } + + @Provides + @Singleton + @Named("mainCommand") + CommandNode provideMainCommand(PlanBungeeCommand command) { + return command; + } +} \ No newline at end of file diff --git a/Plan/src/main/java/com/djrapitops/plan/modules/SpongePlanModule.java b/Plan/src/main/java/com/djrapitops/plan/modules/SpongePlanModule.java new file mode 100644 index 000000000..423e9b8ab --- /dev/null +++ b/Plan/src/main/java/com/djrapitops/plan/modules/SpongePlanModule.java @@ -0,0 +1,33 @@ +package com.djrapitops.plan.modules; + +import com.djrapitops.plan.PlanPlugin; +import com.djrapitops.plan.PlanSponge; +import com.djrapitops.plan.command.PlanCommand; +import com.djrapitops.plugin.command.CommandNode; +import dagger.Module; +import dagger.Provides; + +import javax.inject.Named; +import javax.inject.Singleton; + +/** + * Dagger module for binding PlanSponge instance. + * + * @author Rsl1122 + */ +@Module +public class SpongePlanModule { + + @Provides + @Singleton + PlanPlugin providePlanPlugin(PlanSponge plugin) { + return plugin; + } + + @Provides + @Singleton + @Named("mainCommand") + CommandNode provideMainCommand(PlanCommand command) { + return command; + } +} \ No newline at end of file diff --git a/Plan/src/main/java/com/djrapitops/plan/modules/VelocityPlanModule.java b/Plan/src/main/java/com/djrapitops/plan/modules/VelocityPlanModule.java new file mode 100644 index 000000000..7cb41ed29 --- /dev/null +++ b/Plan/src/main/java/com/djrapitops/plan/modules/VelocityPlanModule.java @@ -0,0 +1,33 @@ +package com.djrapitops.plan.modules; + +import com.djrapitops.plan.PlanPlugin; +import com.djrapitops.plan.PlanVelocity; +import com.djrapitops.plan.command.PlanVelocityCommand; +import com.djrapitops.plugin.command.CommandNode; +import dagger.Module; +import dagger.Provides; + +import javax.inject.Named; +import javax.inject.Singleton; + +/** + * Dagger module for binding PlanVelocity instance. + * + * @author Rsl1122 + */ +@Module +public class VelocityPlanModule { + + @Provides + @Singleton + PlanPlugin providePlanPlugin(PlanVelocity plugin) { + return plugin; + } + + @Provides + @Singleton + @Named("mainCommand") + CommandNode provideMainCommand(PlanVelocityCommand command) { + return command; + } +} \ No newline at end of file diff --git a/Plan/src/test/java/com/djrapitops/plan/BukkitSystemTest.java b/Plan/src/test/java/com/djrapitops/plan/BukkitSystemTest.java index fac4192d1..fd2b47a48 100644 --- a/Plan/src/test/java/com/djrapitops/plan/BukkitSystemTest.java +++ b/Plan/src/test/java/com/djrapitops/plan/BukkitSystemTest.java @@ -25,7 +25,7 @@ public class BukkitSystemTest { @ClassRule public static TemporaryFolder temporaryFolder = new TemporaryFolder(); private PlanSystem bukkitSystem; - private static PlanComponent COMPONENT; + private static PlanBukkitComponent COMPONENT; @BeforeClass public static void setUpClass() throws Exception { @@ -34,7 +34,7 @@ public class BukkitSystemTest { .withPluginDescription() .withResourceFetchingFromJar() .withServer(); - COMPONENT = DaggerPlanComponent.builder().plan(mockUtil.getPlanMock()).build(); + COMPONENT = DaggerPlanBukkitComponent.builder().plan(mockUtil.getPlanMock()).build(); } @Before diff --git a/Plan/src/test/java/com/djrapitops/plan/BungeeBukkitConnectionTest.java b/Plan/src/test/java/com/djrapitops/plan/BungeeBukkitConnectionTest.java index 9edf9f935..993321ecb 100644 --- a/Plan/src/test/java/com/djrapitops/plan/BungeeBukkitConnectionTest.java +++ b/Plan/src/test/java/com/djrapitops/plan/BungeeBukkitConnectionTest.java @@ -25,7 +25,7 @@ public class BungeeBukkitConnectionTest { @ClassRule public static TemporaryFolder temporaryFolder = new TemporaryFolder(); - private static PlanComponent BUKKIT_COMPONENT; + private static PlanBukkitComponent BUKKIT_COMPONENT; private static PlanBungeeComponent BUNGEE_COMPONENT; @Rule @@ -44,7 +44,7 @@ public class BungeeBukkitConnectionTest { .withPluginDescription() .withResourceFetchingFromJar() .withServer(); - BUKKIT_COMPONENT = DaggerPlanComponent.builder().plan(planBukkitMocker.getPlanMock()).build(); + BUKKIT_COMPONENT = DaggerPlanBukkitComponent.builder().plan(planBukkitMocker.getPlanMock()).build(); PlanBungeeMocker planBungeeMocker = PlanBungeeMocker.setUp() .withDataFolder(temporaryFolder.getRoot()) diff --git a/Plan/src/test/java/com/djrapitops/plan/system/settings/network/NetworkSettingsTest.java b/Plan/src/test/java/com/djrapitops/plan/system/settings/network/NetworkSettingsTest.java index b048b7db8..282f16aa4 100644 --- a/Plan/src/test/java/com/djrapitops/plan/system/settings/network/NetworkSettingsTest.java +++ b/Plan/src/test/java/com/djrapitops/plan/system/settings/network/NetworkSettingsTest.java @@ -1,12 +1,14 @@ package com.djrapitops.plan.system.settings.network; +import com.djrapitops.plan.DaggerPlanBungeeComponent; +import com.djrapitops.plan.PlanBungeeComponent; import com.djrapitops.plan.system.database.databases.sql.SQLDB; import com.djrapitops.plan.system.database.databases.sql.tables.ServerTable; import com.djrapitops.plan.system.info.server.Server; import org.junit.*; import org.junit.rules.TemporaryFolder; import utilities.TestConstants; -import utilities.mocks.SystemMockUtil; +import utilities.mocks.PlanBungeeMocker; import static org.junit.Assert.assertEquals; @@ -15,18 +17,16 @@ public class NetworkSettingsTest { @ClassRule public static TemporaryFolder temporaryFolder = new TemporaryFolder(); private static SQLDB db; + private static PlanBungeeComponent COMPONENT; @BeforeClass public static void setUpClass() throws Exception { - SystemMockUtil mockUtil = SystemMockUtil.setUp(temporaryFolder.getRoot()) - .enableConfigSystem(); - db = null; // TODO - mockUtil.enableDatabaseSystem(db) - .enableServerInfoSystem(); - -// Log.setErrorManager(new TestErrorManager()); -// Log.setDebugMode("console"); -// Settings.DEV_MODE.setTemporaryValue(true); + PlanBungeeMocker planBungeeMocker = PlanBungeeMocker.setUp() + .withDataFolder(temporaryFolder.getRoot()) + .withPluginDescription() + .withResourceFetchingFromJar() + .withProxy(); + COMPONENT = DaggerPlanBungeeComponent.builder().plan(planBungeeMocker.getPlanMock()).build(); } @AfterClass