Allow RS loading classes to be used with Guice
- Provide OkHttpClient through Guice instead of using it from static variable - Chain the RS classes with Guice and inject ClientLoader to RuneLite class - Cleanup RS loading classes a bit Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
package net.runelite.client.rs;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.client.rs.ClientConfigLoader;
|
||||
import okhttp3.OkHttpClient;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
@@ -38,16 +38,20 @@ public class ClientConfigLoaderTest
|
||||
@Test
|
||||
public void test() throws IOException
|
||||
{
|
||||
ClientConfigLoader loader = new ClientConfigLoader();
|
||||
loader.fetch();
|
||||
final ClientConfigLoader loader = new ClientConfigLoader(new OkHttpClient());
|
||||
final RSConfig config = loader.fetch();
|
||||
|
||||
for (String key : loader.getProperties().keySet())
|
||||
System.out.println(key + ": " + loader.getProperty(key));
|
||||
for (String key : config.getClassLoaderProperties().keySet())
|
||||
{
|
||||
System.out.println(key + ": " + config.getClassLoaderProperties().get(key));
|
||||
}
|
||||
|
||||
System.out.println("Applet properties:");
|
||||
|
||||
for (String key : loader.getAppletProperties().keySet())
|
||||
System.out.println(key + ": " + loader.getAppletProperty(key));
|
||||
for (String key : config.getAppletProperties().keySet())
|
||||
{
|
||||
System.out.println(key + ": " + config.getAppletProperties().get(key));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user