Make HiscoreClient call the OSRS hiscore API directly
This commit is contained in:
@@ -91,7 +91,7 @@ public class HiscoreServiceTest
|
||||
{
|
||||
HiscoreTestService hiscores = new HiscoreTestService(server.url("/"));
|
||||
|
||||
HiscoreResult result = hiscores.lookupUsername("zezima", HiscoreEndpoint.NORMAL).build();
|
||||
HiscoreResult result = hiscores.lookupUsername("zezima", HiscoreEndpoint.NORMAL.getHiscoreURL());
|
||||
|
||||
Assert.assertEquals(50, result.getAttack().getLevel());
|
||||
Assert.assertEquals(159727L, result.getFishing().getExperience());
|
||||
|
||||
@@ -27,7 +27,7 @@ package net.runelite.http.service.hiscore;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import net.runelite.http.api.hiscore.HiscoreEndpoint;
|
||||
import net.runelite.http.api.hiscore.HiscoreResult;
|
||||
import okhttp3.HttpUrl;
|
||||
|
||||
class HiscoreTestService extends HiscoreService
|
||||
@@ -40,15 +40,8 @@ class HiscoreTestService extends HiscoreService
|
||||
}
|
||||
|
||||
@Override
|
||||
public HiscoreResultBuilder lookupUsername(String username, HiscoreEndpoint endpoint) throws ExecutionException
|
||||
public HiscoreResult lookupUsername(String username, HttpUrl endpoint) throws IOException
|
||||
{
|
||||
try
|
||||
{
|
||||
return super.lookupUsername(username, testUrl);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new ExecutionException(e);
|
||||
}
|
||||
return super.lookupUsername(username, testUrl);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user