Skip to content

Commit

Permalink
add player lookup tests and metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Sep 24, 2024
1 parent 6440f5e commit 20d063f
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,15 @@
}
]
},
{
"type": "com.sun.crypto.provider.TlsKeyMaterialGenerator",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "com.sun.crypto.provider.TlsMasterSecretGenerator",
"methods": [
Expand All @@ -880,6 +889,15 @@
}
]
},
{
"type": "com.sun.crypto.provider.TlsPrfGenerator$V12",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "com.sun.management.GarbageCollectionNotificationInfo"
},
Expand Down Expand Up @@ -14952,6 +14970,18 @@
"name": "killsTopMonthTest",
"parameterTypes": []
},
{
"name": "playerLookupCraftheadTest",
"parameterTypes": []
},
{
"name": "playerLookupMinetoolsTest",
"parameterTypes": []
},
{
"name": "playerLookupMojangTest",
"parameterTypes": []
},
{
"name": "playtimeApiTest",
"parameterTypes": []
Expand Down Expand Up @@ -15086,6 +15116,47 @@
}
]
},
{
"type": "vc.api.model.CraftheadProfileProperties",
"allDeclaredFields": true,
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.lang.String",
"java.lang.String"
]
}
]
},
{
"type": "vc.api.model.CraftheadProfileResponse",
"allDeclaredFields": true,
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.lang.String",
"java.lang.String",
"java.util.List"
]
}
]
},
{
"type": "vc.api.model.MinetoolsUuidResponse",
"allDeclaredFields": true,
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.lang.String",
"java.lang.String",
"java.lang.String"
]
}
]
},
{
"type": "vc.api.model.MojangProfileResponse",
"allDeclaredFields": true,
Expand Down Expand Up @@ -16436,6 +16507,17 @@
{
"type": "[Lcom.sun.management.internal.DiagnosticCommandInfo;"
},
{
"type": "com.intellij.rt.junit.JUnitStarter",
"methods": [
{
"name": "main",
"parameterTypes": [
"java.lang.String[]"
]
}
]
},
{
"type": "com.sun.management.internal.DiagnosticCommandArgumentInfo",
"methods": [
Expand Down Expand Up @@ -16567,9 +16649,24 @@
}
],
"methods": [
{
"name": "checkAndLoadMain",
"parameterTypes": [
"boolean",
"int",
"java.lang.String"
]
},
{
"name": "getApplicationClass",
"parameterTypes": []
},
{
"name": "makePlatformString",
"parameterTypes": [
"boolean",
"byte[]"
]
}
]
},
Expand Down
30 changes: 30 additions & 0 deletions src/test/java/vc/ApiTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.test.web.server.LocalServerPort;
import vc.api.CraftheadRestClient;
import vc.api.MinetoolsRestClient;
import vc.api.MojangRestClient;
import vc.controller.*;
import vc.data.dto.tables.MaxConsMonthView;
import vc.data.dto.tables.pojos.Queuelength;
Expand All @@ -28,6 +31,12 @@ static boolean isTestEnabled() {

@Autowired
private TestRestTemplate restTemplate;
@Autowired
private MojangRestClient mojangRestClient;
@Autowired
private CraftheadRestClient craftheadRestClient;
@Autowired
private MinetoolsRestClient minetoolsRestClient;

@Test
public void homepageTest() {
Expand Down Expand Up @@ -212,4 +221,25 @@ public void priorityPlayersApiTest() {
assertNotNull(response);
assertFalse(response.isEmpty());
}

@Test
public void playerLookupMinetoolsTest() {
var response = minetoolsRestClient.getProfileFromUsername("rfresh2");
assertNotNull(response);
assertEquals("rfresh2", response.name());
}

@Test
public void playerLookupMojangTest() {
var response = mojangRestClient.getProfileFromUsername("rfresh2");
assertNotNull(response);
assertEquals("rfresh2", response.name());
}

@Test
public void playerLookupCraftheadTest() {
var response = craftheadRestClient.getProfile("rfresh2");
assertNotNull(response);
assertEquals("rfresh2", response.name());
}
}

0 comments on commit 20d063f

Please sign in to comment.