use of no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder in project L4J8 by stelar7.
the class SummonerTest method testById.
@Test
public void testById() {
/*
Summoner ids have been removed from the spectator endpoint, so this test wont work anymore...
String id = new SpectatorBuilder().withPlatform(Platform.EUW1).getFeaturedGames().get(0).getParticipants().get(0).getSummonerId();
Summoner s = new SummonerBuilder().withPlatform(Platform.EUW1).withSummonerId(id).get();
*/
String id = new SpectatorBuilder().withPlatform(LeagueShard.EUW1).getFeaturedGames().get(0).getParticipants().get(0).getSummonerName();
Summoner s = new SummonerBuilder().withPlatform(LeagueShard.EUW1).withName(id).get();
doAssertions.accept(s);
}
use of no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder 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.summoner.SummonerBuilder 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.summoner.SummonerBuilder 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.summoner.SummonerBuilder in project L4J8 by stelar7.
the class CheckNormalGameForWinTest method testFindSelfInNormalGame.
@Test
@Disabled
public void testFindSelfInNormalGame() {
Summoner summoner = new SummonerBuilder().withPlatform(LeagueShard.NA1).withName("devitgg").get();
List<String> refs = new MatchListBuilder().withPlatform(LeagueShard.NA1).withPuuid(summoner.getPUUID()).get();
for (String current : refs) {
LOLMatch match = LOLMatch.get(LeagueShard.NA1, current);
MatchParticipant self = match.getParticipants().stream().filter(p -> p.getPuuid().equals(summoner.getPUUID())).findFirst().get();
System.out.println("I " + (self.didWin() ? "won!" : "lost :("));
}
}
Aggregations