Finish gist
This commit is contained in:
@@ -9,7 +9,7 @@ public class APIFootballConnectorTest {
|
||||
|
||||
@Test
|
||||
public void APITestGetMatchDataOfMatchdayBundesliga() {
|
||||
APIFootballConnector apiFootballConnector = new APIFootballConnector(2020);
|
||||
APIFootballConnector apiFootballConnector = APIFootballConnector.getAPIFootballConnectorInstance(2020);
|
||||
ArrayList<APIFootballMatch> matchesOfMatchday = apiFootballConnector.getMatchDataByLeagueAndMatchday(2677, 1);
|
||||
assert matchesOfMatchday.get(0).getTeamIdHome() == 744;
|
||||
assert matchesOfMatchday.get(0).getTeamIdGuest() == 159;
|
||||
|
||||
@@ -16,5 +16,13 @@ public class APIFootballUpdaterTest {
|
||||
public void updateAllFixturesTest() throws IOException {
|
||||
APIFootballUpdater updater = new APIFootballUpdater(2021);
|
||||
updater.updateAllFixtures("Tippliga.json");
|
||||
updater.updateAllFixtures("WTL_Pokal.json");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateAllRoundsTest() throws IOException {
|
||||
APIFootballUpdater updater = new APIFootballUpdater(2021);
|
||||
updater.updateAllRounds("Tippliga.json");
|
||||
updater.updateAllRounds("WTL_Pokal.json");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,42 +12,43 @@ public class GistProviderTest {
|
||||
|
||||
@Test
|
||||
public void listAllGistsTest() {
|
||||
GistProvider prov = new GistProvider();
|
||||
GistProvider prov = GistProvider.getInstance();
|
||||
JSONArray gists = prov.listAllGists();
|
||||
System.out.println(gists);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getFileTest() {
|
||||
GistProvider prov = new GistProvider();
|
||||
String file = prov.getFile("Team_ID_Matcher.json");
|
||||
GistProvider prov = GistProvider.getInstance();
|
||||
String id = prov.getGistID("Team_ID_Matcher");
|
||||
String file = prov.getFileFromGist(id,"Team_ID_Matcher.json");
|
||||
System.out.println(file);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getTeamIdMatcherTest() {
|
||||
GistProvider prov = new GistProvider();
|
||||
GistProvider prov = GistProvider.getInstance();
|
||||
JSONArray matcher = prov.getTeamIdMatcher();
|
||||
System.out.println(matcher);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getGistUpdatedTimestampTest() {
|
||||
GistProvider prov = new GistProvider();
|
||||
GistProvider prov = GistProvider.getInstance();
|
||||
DateTime date = prov.getGistUpdatedTimestamp("Matches");
|
||||
System.out.println(date);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getGistIDTest() {
|
||||
GistProvider prov = new GistProvider();
|
||||
GistProvider prov = GistProvider.getInstance();
|
||||
String id = prov.getGistID("Matches");
|
||||
System.out.println(id);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateGistTest() throws UnsupportedEncodingException {
|
||||
GistProvider prov = new GistProvider();
|
||||
GistProvider prov = GistProvider.getInstance();
|
||||
APIFootballUpdater updater = new APIFootballUpdater(2021);
|
||||
String body = updater.getRawData("https://v2.api-football.com/fixtures/league/2738?timezone=Europe/Berlin");
|
||||
String content = prov.updateGist("6ec51d59cac70c9f4c040eeea1c0cdd9", "matches_league_2738.json", body);
|
||||
|
||||
Reference in New Issue
Block a user