use of no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder in project L4J8 by stelar7.
the class ChampionMasteryTest method testChampionMasteryAll.
@Test
public void testChampionMasteryAll() {
String id = new SpectatorBuilder().withPlatform(LeagueShard.EUW1).getFeaturedGames().get(0).getParticipants().get(0).getSummonerName();
Summoner s = new SummonerBuilder().withPlatform(LeagueShard.EUW1).withName(id).get();
List<ChampionMastery> all = new ChampionMasteryBuilder().withPlatform(s.getPlatform()).withSummonerId(s.getSummonerId()).getChampionMasteries();
assert all != null;
}
use of no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder in project L4J8 by stelar7.
the class ChampionMasteryTest method testChampionMasteryTop.
@Test
public void testChampionMasteryTop() {
String id = new SpectatorBuilder().withPlatform(LeagueShard.EUW1).getFeaturedGames().get(0).getParticipants().get(0).getSummonerName();
Summoner s = new SummonerBuilder().withPlatform(LeagueShard.EUW1).withName(id).get();
List<ChampionMastery> all = new ChampionMasteryBuilder().withPlatform(s.getPlatform()).withSummonerId(s.getSummonerId()).getTopChampions(null);
assert all != null;
}
use of no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder in project L4J8 by stelar7.
the class ChampionMasteryTest method testChampionMastery.
@Test
public void testChampionMastery() {
String id = new SpectatorBuilder().withPlatform(LeagueShard.EUW1).getFeaturedGames().get(0).getParticipants().get(0).getSummonerName();
Summoner s = new SummonerBuilder().withPlatform(LeagueShard.EUW1).withName(id).get();
ChampionMastery mastery;
ChampionMasteryBuilder bu = new ChampionMasteryBuilder().withPlatform(s.getPlatform()).withSummonerId(s.getSummonerId());
mastery = bu.withChampionId(1).getChampionMastery();
assert mastery != null;
mastery = bu.withChampionId(2).getChampionMastery();
assert mastery != null;
}
use of no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder in project L4J8 by stelar7.
the class RatelimitTest method testRateLimitThreaded.
@Test
@Disabled
public void testRateLimitThreaded() {
try {
String name = new SpectatorBuilder().withPlatform(LeagueShard.EUW1).getFeaturedGames().get(0).getParticipants().get(0).getSummonerName();
Summoner s = new SummonerBuilder().withPlatform(LeagueShard.EUW1).withName(name).get();
ExecutorService pool = Executors.newFixedThreadPool(8);
for (int i2 = 0; i2 < 130; i2++) {
pool.execute(() -> new SummonerBuilder().withPlatform(LeagueShard.EUW1).withSummonerId(s.getSummonerId()).get());
}
pool.shutdown();
pool.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
use of no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder in project L4J8 by stelar7.
the class RatelimitTest method testRateLimitWithSleep.
@Test
@Disabled
public void testRateLimitWithSleep() throws InterruptedException {
String id = new SpectatorBuilder().withPlatform(LeagueShard.EUW1).getFeaturedGames().get(0).getParticipants().get(0).getSummonerName();
Summoner s = new SummonerBuilder().withPlatform(LeagueShard.EUW1).withName(id).get();
new SummonerBuilder().withPlatform(LeagueShard.EUW1).withSummonerId(id).get();
TimeUnit.SECONDS.sleep(10);
new SummonerBuilder().withPlatform(LeagueShard.EUW1).withSummonerId(id).get();
}
Aggregations