Search in sources :

Example 1 with SpectatorGameInfo

use of no.stelar7.api.r4j.pojo.lol.spectator.SpectatorGameInfo in project L4J8 by stelar7.

the class FeaturedGameTest method testCurrentGame.

@Test
public void testCurrentGame() {
    final L4J8 l4j8 = new L4J8(SecretFile.CREDS);
    SpectatorBuilder sb = new SpectatorBuilder().withPlatform(Platform.EUW1);
    final List<SpectatorGameInfo> game = sb.getFeaturedGames();
    doAssertions.accept(game);
}
Also used : SpectatorGameInfo(no.stelar7.api.l4j8.pojo.spectator.SpectatorGameInfo) L4J8(no.stelar7.api.l4j8.impl.L4J8) SpectatorBuilder(no.stelar7.api.l4j8.impl.builders.spectator.SpectatorBuilder)

Example 2 with SpectatorGameInfo

use of no.stelar7.api.r4j.pojo.lol.spectator.SpectatorGameInfo in project L4J8 by stelar7.

the class FeaturedGameTest method testCurrentGame.

@Test
public void testCurrentGame() {
    final R4J r4J = new R4J(SecretFile.CREDS);
    SpectatorBuilder sb = new SpectatorBuilder().withPlatform(LeagueShard.EUW1);
    final List<SpectatorGameInfo> game = sb.getFeaturedGames();
    doAssertions.accept(game);
}
Also used : SpectatorGameInfo(no.stelar7.api.r4j.pojo.lol.spectator.SpectatorGameInfo) R4J(no.stelar7.api.r4j.impl.R4J) SpectatorBuilder(no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder)

Example 3 with SpectatorGameInfo

use of no.stelar7.api.r4j.pojo.lol.spectator.SpectatorGameInfo in project L4J8 by stelar7.

the class CurrentGameTest method testCurrentGame.

@Test
public void testCurrentGame() {
    final L4J8 l4j8 = new L4J8(SecretFile.CREDS);
    SpectatorBuilder sb = new SpectatorBuilder().withPlatform(Platform.EUW1);
    // Get a game in progess
    final List<SpectatorGameInfo> game = sb.getFeaturedGames();
    // Get a summoner from that game
    final String name = game.get(0).getParticipants().get(0).getSummonerName();
    final Summoner sum = new SummonerBuilder().withPlatform(Constants.TEST_PLATFORM[0]).withName(name).get();
    // Get game info
    final SpectatorGameInfo currentGame = sb.withSummonerId(sum.getSummonerId()).getCurrentGame();
    if (currentGame != null) {
        doAssertions.accept(currentGame);
    }
}
Also used : Summoner(no.stelar7.api.l4j8.pojo.summoner.Summoner) SpectatorGameInfo(no.stelar7.api.l4j8.pojo.spectator.SpectatorGameInfo) L4J8(no.stelar7.api.l4j8.impl.L4J8) SummonerBuilder(no.stelar7.api.l4j8.impl.builders.summoner.SummonerBuilder) SpectatorBuilder(no.stelar7.api.l4j8.impl.builders.spectator.SpectatorBuilder)

Example 4 with SpectatorGameInfo

use of no.stelar7.api.r4j.pojo.lol.spectator.SpectatorGameInfo in project L4J8 by stelar7.

the class CurrentGameTest method testCurrentlyNotInGame.

@Test
public void testCurrentlyNotInGame() {
    final L4J8 l4j8 = new L4J8(SecretFile.CREDS);
    SpectatorBuilder sb = new SpectatorBuilder().withPlatform(Constants.TEST_PLATFORM[0]).withSummonerId(Constants.TEST_SUMMONER_IDS[0]);
    SpectatorGameInfo game = sb.getCurrentGame();
    System.out.format("%s is %sin game%n", Constants.TEST_SUMMONER_NAMES[0], game != null ? "" : "not ");
}
Also used : SpectatorGameInfo(no.stelar7.api.l4j8.pojo.spectator.SpectatorGameInfo) L4J8(no.stelar7.api.l4j8.impl.L4J8) SpectatorBuilder(no.stelar7.api.l4j8.impl.builders.spectator.SpectatorBuilder)

Example 5 with SpectatorGameInfo

use of no.stelar7.api.r4j.pojo.lol.spectator.SpectatorGameInfo in project L4J8 by stelar7.

the class CurrentGameTest method testCurrentGameFame.

@Test
public void testCurrentGameFame() {
    final R4J r4J = new R4J(SecretFile.CREDS);
    Summoner s = Summoner.byName(LeagueShard.EUW1, "Klospülautomat");
    SpectatorGameInfo game = s.getCurrentGame();
    System.out.format("%s is %sin game%n", s.getName(), game != null ? "" : "not ");
}
Also used : Summoner(no.stelar7.api.r4j.pojo.lol.summoner.Summoner) SpectatorGameInfo(no.stelar7.api.r4j.pojo.lol.spectator.SpectatorGameInfo) R4J(no.stelar7.api.r4j.impl.R4J)

Aggregations

L4J8 (no.stelar7.api.l4j8.impl.L4J8)3 SpectatorBuilder (no.stelar7.api.l4j8.impl.builders.spectator.SpectatorBuilder)3 SpectatorGameInfo (no.stelar7.api.l4j8.pojo.spectator.SpectatorGameInfo)3 R4J (no.stelar7.api.r4j.impl.R4J)3 SpectatorBuilder (no.stelar7.api.r4j.impl.lol.builders.spectator.SpectatorBuilder)3 SpectatorGameInfo (no.stelar7.api.r4j.pojo.lol.spectator.SpectatorGameInfo)3 SummonerBuilder (no.stelar7.api.r4j.impl.lol.builders.summoner.SummonerBuilder)2 Summoner (no.stelar7.api.r4j.pojo.lol.summoner.Summoner)2 SummonerBuilder (no.stelar7.api.l4j8.impl.builders.summoner.SummonerBuilder)1 Summoner (no.stelar7.api.l4j8.pojo.summoner.Summoner)1 LOLMatch (no.stelar7.api.r4j.pojo.lol.match.v5.LOLMatch)1