Search in sources :

Example 16 with SpectatorBuilder

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;
}
Also used : Summoner(no.stelar7.api.r4j.pojo.lol.summoner.Summoner) ChampionMasteryBuilder(no.stelar7.api.r4j.impl.lol.builders.championmastery.ChampionMasteryBuilder) SummonerBuilder(no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder) ChampionMastery(no.stelar7.api.r4j.pojo.lol.championmastery.ChampionMastery) SpectatorBuilder(no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder)

Example 17 with SpectatorBuilder

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;
}
Also used : Summoner(no.stelar7.api.r4j.pojo.lol.summoner.Summoner) ChampionMasteryBuilder(no.stelar7.api.r4j.impl.lol.builders.championmastery.ChampionMasteryBuilder) SummonerBuilder(no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder) ChampionMastery(no.stelar7.api.r4j.pojo.lol.championmastery.ChampionMastery) SpectatorBuilder(no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder)

Example 18 with SpectatorBuilder

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;
}
Also used : Summoner(no.stelar7.api.r4j.pojo.lol.summoner.Summoner) ChampionMasteryBuilder(no.stelar7.api.r4j.impl.lol.builders.championmastery.ChampionMasteryBuilder) SummonerBuilder(no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder) ChampionMastery(no.stelar7.api.r4j.pojo.lol.championmastery.ChampionMastery) SpectatorBuilder(no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder)

Example 19 with SpectatorBuilder

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();
    }
}
Also used : Summoner(no.stelar7.api.r4j.pojo.lol.summoner.Summoner) SummonerBuilder(no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder) SpectatorBuilder(no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder)

Example 20 with SpectatorBuilder

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();
}
Also used : Summoner(no.stelar7.api.r4j.pojo.lol.summoner.Summoner) SummonerBuilder(no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder) SpectatorBuilder(no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder)

Aggregations

SpectatorBuilder (no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder)17 SummonerBuilder (no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder)16 Summoner (no.stelar7.api.r4j.pojo.lol.summoner.Summoner)14 SpectatorBuilder (no.stelar7.api.l4j8.impl.builders.spectator.SpectatorBuilder)4 ChampionMasteryBuilder (no.stelar7.api.r4j.impl.lol.builders.championmastery.ChampionMasteryBuilder)4 L4J8 (no.stelar7.api.l4j8.impl.L4J8)3 SpectatorGameInfo (no.stelar7.api.l4j8.pojo.spectator.SpectatorGameInfo)3 R4J (no.stelar7.api.r4j.impl.R4J)3 ChampionMastery (no.stelar7.api.r4j.pojo.lol.championmastery.ChampionMastery)3 SummonerBuilder (no.stelar7.api.l4j8.impl.builders.summoner.SummonerBuilder)2 Summoner (no.stelar7.api.l4j8.pojo.summoner.Summoner)2 CacheLifetimeHint (no.stelar7.api.r4j.basic.cache.CacheLifetimeHint)2 LOLMatch (no.stelar7.api.r4j.pojo.lol.match.v5.LOLMatch)2 SpectatorGameInfo (no.stelar7.api.r4j.pojo.lol.spectator.SpectatorGameInfo)2 MatchListBuilder (no.stelar7.api.l4j8.impl.builders.match.MatchListBuilder)1 URLEndpoint (no.stelar7.api.r4j.basic.constants.api.URLEndpoint)1 LeagueBuilder (no.stelar7.api.r4j.impl.lol.builders.league.LeagueBuilder)1 MatchListBuilder (no.stelar7.api.r4j.impl.lol.builders.matchv5.match.MatchListBuilder)1 LeagueEntry (no.stelar7.api.r4j.pojo.lol.league.LeagueEntry)1