Skip to content

Commit

Permalink
Fix an issue where the match wasnt cached
Browse files Browse the repository at this point in the history
  • Loading branch information
stelar7 committed Aug 31, 2017
1 parent f246e15 commit afbad84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/no/stelar7/api/l4j8/impl/MatchAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public Match getMatch(Platform server, long matchId)
}

Match match = (Match) builder.build();
DataCall.getCacheProvider().store(URLEndpoint.V3_MATCH, match, server);
DataCall.getCacheProvider().store(URLEndpoint.V3_MATCH, match, matchId, server);
return match;
}

Expand Down
10 changes: 7 additions & 3 deletions src/test/java/no/stelar7/api/l4j8/tests/example/UseageTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package no.stelar7.api.l4j8.tests.example;

import no.stelar7.api.l4j8.basic.constants.api.Platform;
import no.stelar7.api.l4j8.basic.cache.FileSystemCacheProvider;
import no.stelar7.api.l4j8.basic.calling.DataCall;
import no.stelar7.api.l4j8.basic.constants.api.*;
import no.stelar7.api.l4j8.basic.constants.flags.*;
import no.stelar7.api.l4j8.basic.constants.types.TierDivisionType;
import no.stelar7.api.l4j8.impl.L4J8;
Expand All @@ -21,6 +23,8 @@ public class UseageTest
public void testUseage()
{
L4J8 api = new L4J8(SecretFile.CREDS);
DataCall.setLogLevel(LogLevel.INFO);
DataCall.setCacheProvider(new FileSystemCacheProvider());

Summoner stelar7 = api.getSummonerAPI().getSummonerByName(Platform.EUW1, "stelar7");
List<MatchReference> games = stelar7.getRankedGames();
Expand All @@ -37,8 +41,8 @@ public void testUseage()
Participant self = match.getParticipantFromSummonerId(stelar7.getSummonerId());
boolean didWin = match.didWin(self);
System.out.format("They %s that game%n", didWin ? "won" : "lost");


ParticipantIdentity opponentIdentity = match.getLaneOpponentIdentity(self);
Participant opponent = match.getParticipantFromParticipantId(opponentIdentity.getParticipantId());

Expand Down

0 comments on commit afbad84

Please sign in to comment.