diff --git a/src/main/java/no/stelar7/api/r4j/impl/shared/AccountAPI.java b/src/main/java/no/stelar7/api/r4j/impl/shared/AccountAPI.java index 646e23ad..7de4a85c 100644 --- a/src/main/java/no/stelar7/api/r4j/impl/shared/AccountAPI.java +++ b/src/main/java/no/stelar7/api/r4j/impl/shared/AccountAPI.java @@ -76,6 +76,7 @@ public RiotAccount getAccountByTag(RegionShard server, String name, String tag, data.put("platform", server); data.put("name", Utils.normalizeString(name)); data.put("tag", Utils.normalizeString(tag)); + data.put("keytype", keyType); Optional chl = DataCall.getCacheProvider().get(URLEndpoint.V1_SHARED_ACCOUNT_BY_TAG, data); if (chl.isPresent()) diff --git a/src/test/java/no/stelar7/api/r4j/tests/shared/TestSharedAccount.java b/src/test/java/no/stelar7/api/r4j/tests/shared/TestSharedAccount.java index c5d53d5b..3a3ba1cd 100644 --- a/src/test/java/no/stelar7/api/r4j/tests/shared/TestSharedAccount.java +++ b/src/test/java/no/stelar7/api/r4j/tests/shared/TestSharedAccount.java @@ -1,6 +1,7 @@ package no.stelar7.api.r4j.tests.shared; import no.stelar7.api.r4j.basic.constants.api.regions.*; +import no.stelar7.api.r4j.basic.constants.types.ApiKeyType; import no.stelar7.api.r4j.impl.R4J; import no.stelar7.api.r4j.pojo.shared.*; import no.stelar7.api.r4j.tests.SecretFile; @@ -11,22 +12,22 @@ public class TestSharedAccount { @Test - @Order(2) - public void getByPUUID() + @Order(1) + public void getByTag() { R4J api = new R4J(SecretFile.CREDS); - RiotAccount accountTag = api.getAccountAPI().getAccountByTag(RegionShard.EUROPE, "stelar7", "STL7"); - RiotAccount account = api.getAccountAPI().getAccountByPUUID(RegionShard.EUROPE, accountTag.getPUUID()); + RiotAccount account = api.getAccountAPI().getAccountByTag(RegionShard.EUROPE, "stelar7", "STL7"); System.out.println(account); } @Test - @Order(1) - public void getByTag() + @Order(2) + public void getByPUUID() { - R4J api = new R4J(SecretFile.CREDS); - RiotAccount account = api.getAccountAPI().getAccountByTag(RegionShard.EUROPE, "stelar7", "STL7"); + R4J api = new R4J(SecretFile.CREDS); + RiotAccount accountTag = api.getAccountAPI().getAccountByTag(RegionShard.EUROPE, "stelar7", "STL7"); + RiotAccount account = api.getAccountAPI().getAccountByPUUID(RegionShard.EUROPE, accountTag.getPUUID()); System.out.println(account); } @@ -35,11 +36,23 @@ public void getByTag() @Order(3) public void getShards() { - R4J api = new R4J(SecretFile.CREDS); + R4J api = new R4J(SecretFile.CREDS); RiotAccount account = api.getAccountAPI().getAccountByTag(RegionShard.EUROPE, "stelar7", "STL7"); RiotAccountShard shard = api.getAccountAPI().getActiveShard(RegionShard.AMERICAS, ShardableGame.LOR, account.getPUUID()); System.out.println(shard); System.out.println(shard.getShardAsEnum()); } + + @Test + @Order(4) + public void getByTagDifferentKeyType() + { + R4J api = new R4J(SecretFile.CREDS); + RiotAccount accountLoL = api.getAccountAPI().getAccountByTag(RegionShard.EUROPE, "stelar7", "STL7", ApiKeyType.LOL); + RiotAccount accountTfT = api.getAccountAPI().getAccountByTag(RegionShard.EUROPE, "stelar7", "STL7", ApiKeyType.TFT); + + System.out.println(accountLoL); + System.out.println(accountTfT); + } }