@Before public void before() throws IOException { RuneLite.setOptions(mock(OptionSet.class)); Injector injector = Guice.createInjector(new RuneLiteModule(), BoundFieldModule.of(this)); RuneLite.setInjector(injector); runelite = injector.getInstance(RuneLite.class); runelite.setGui(clientUi); runelite.setNotifier(notifier); // Find plugins we expect to have pluginClasses = new HashSet<>(); Set<ClassInfo> classes = ClassPath.from(getClass().getClassLoader()).getTopLevelClassesRecursive(PLUGIN_PACKAGE); for (ClassInfo classInfo : classes) { Class<?> clazz = classInfo.load(); PluginDescriptor pluginDescriptor = clazz.getAnnotation(PluginDescriptor.class); if (pluginDescriptor != null) { pluginClasses.add(clazz); } } }
@Before public void before(){ logger = mock(Logger.class); Module testModule = Modules.override(new UnXmlModule()).with(BoundFieldModule.of(this)); Guice.createInjector(testModule).injectMembers(this); util = parsing.xml(); }
/** * Creates a context based on the fields of the current test. */ protected final void createContextOfTest() { context = new GuiceContext(this, () -> Arrays.asList(BoundFieldModule.of(this))); context.init(); }
@Before public void before() { Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this); }
@Before public void before() { Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this); when(slayerConfig.enabled()).thenReturn(true); }
@Before public void before(){ logger = mock(Logger.class); Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this); }
@Before public void before(){ logger = mock(Logger.class); Module testModule = Modules.override(new UnXmlModule()).with(BoundFieldModule.of(this)); Guice.createInjector(testModule).injectMembers(this); }