Refactor API Football to v3
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user