Refactor API Football to v3

This commit is contained in:
2025-01-26 22:03:10 +01:00
parent b27648885d
commit ffa6821549
24 changed files with 1719 additions and 242 deletions
@@ -8,20 +8,20 @@ public class APIFootballUpdaterTest {
@Test
public void checkErrorsTest() {
String exceededLimitDayError = "{\"api\":{\"results\":0,\"error\":\"You have reached the request limit for the day\"}}";
String rateLimitError = "{\"results\":0,\"errors\":{\"rateLimit\":\"Too many requests. Your rate limit is 10 requests per minute.\"}}";
APIFootballUpdater updater = new APIFootballUpdater();
try {
updater.checkErrors("https://test.url/api", exceededLimitDayError);
updater.checkErrors("https://test.url/api", rateLimitError);
} catch (Exception e) {
System.out.println(e.getMessage());
assert e.getMessage().equals("https://test.url/api returned error: 'You have reached the request limit for the day'");
assert e.getMessage().equals("https://test.url/api returned error: '{\"rateLimit\":\"Too many requests. Your rate limit is 10 requests per minute.\"}'");
}
}
@Test
public void updateFixturesTest() {
APIFootballUpdater updater = new APIFootballUpdater();
// updater.updateFixtures(1240);
updater.updateFixtures(2025, 79);
}
@Test