Finish gist

This commit is contained in:
2020-10-17 01:20:51 +02:00
parent e4186457e2
commit cb01b7bcb7
51 changed files with 155 additions and 132281 deletions

View File

@@ -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;

View File

@@ -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");
}
}

View File

@@ -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);