From 557cd59c8fb0beedc9f2b1596edbd67f0e98e162 Mon Sep 17 00:00:00 2001 From: Julian Arndt Date: Sun, 4 Oct 2020 12:23:43 +0200 Subject: [PATCH] Clean up shit --- src/main/java/de/jeyp91/TeamIDMatcher.java | 4 +- .../java/de/jeyp91/tippliga/TLWMatch.java | 59 +++++- .../tippliga/TLWMatchesManagerBase.java | 4 - .../tippliga/TLWMatchesUpdaterFootball.java | 180 +++++++++++++++++- src/main/java/de/jeyp91/tippliga/TLWTeam.java | 15 ++ .../de/jeyp91/tippliga/TLWTeamsCreator.java | 2 +- .../de/jeyp91/tippliga/TLWTeamsUpdater.java | 4 - .../jeyp91/tippliga/TippligaSQLConnector.java | 45 +++-- .../resources/Team_ID_TLW_APIF_config.json | 10 + .../java/de/jeyp91/TeamIDMatcherTest.java | 28 +-- .../TLWMatchesUpdaterFootballTest.java | 4 - .../jeyp91/tippliga/TLWTeamsUpdaterTest.java | 5 - .../tippliga/TippligaSQLConnectorTest.java | 8 +- tokens/StoredCredential | Bin 1081 -> 1081 bytes 14 files changed, 300 insertions(+), 68 deletions(-) diff --git a/src/main/java/de/jeyp91/TeamIDMatcher.java b/src/main/java/de/jeyp91/TeamIDMatcher.java index e4d527c..8465436 100644 --- a/src/main/java/de/jeyp91/TeamIDMatcher.java +++ b/src/main/java/de/jeyp91/TeamIDMatcher.java @@ -37,7 +37,7 @@ public class TeamIDMatcher { } } - public static Integer getOpenLigaDbIdFromTippligaId(int id) { + public static Integer getApiFootballIdFromTippligaId(int id) { if(ids == null) { initBiMap(); } @@ -50,7 +50,7 @@ public class TeamIDMatcher { } } - public static Integer getTippligaIdFromOpenLigaDbId(Integer id) { + public static Integer getTippligaIdFromApiFootballId(Integer id) { if(id == null) return null; if(ids == null) { initBiMap(); diff --git a/src/main/java/de/jeyp91/tippliga/TLWMatch.java b/src/main/java/de/jeyp91/tippliga/TLWMatch.java index b69dd65..4655330 100644 --- a/src/main/java/de/jeyp91/tippliga/TLWMatch.java +++ b/src/main/java/de/jeyp91/tippliga/TLWMatch.java @@ -11,7 +11,7 @@ import de.jeyp91.openligadb.OpenLigaDBMatch; /** * */ -public class TLWMatch extends BaseMatch { +public class TLWMatch extends BaseMatch{ public final Integer STATUS_NOTSTARTED = 0; public final Integer STATUS_STARTED = 1; @@ -94,8 +94,8 @@ public class TLWMatch extends BaseMatch { this.league = league; this.matchday = matchday; this.matchNo = matchNo; - this.teamIdHome = TeamIDMatcher.getTippligaIdFromOpenLigaDbId(oldbmatch.getTeamIdHome()); - this.teamIdGuest = TeamIDMatcher.getTippligaIdFromOpenLigaDbId(oldbmatch.getTeamIdGuest()); + this.teamIdHome = TeamIDMatcher.getTippligaIdFromApiFootballId(oldbmatch.getTeamIdHome()); + this.teamIdGuest = TeamIDMatcher.getTippligaIdFromApiFootballId(oldbmatch.getTeamIdGuest()); this.goalsHome = oldbmatch.getGoalsHome(); this.goalsGuest = oldbmatch.getGoalsGuest(); this.matchDatetime = oldbmatch.getMatchDateTime().replace("T", " "); @@ -105,16 +105,16 @@ public class TLWMatch extends BaseMatch { this.status = 0; } - public TLWMatch(APIFootballMatch APIFootballMatch, int season, int league, int matchday, int matchNo, int status, int koMatch) { + public TLWMatch(APIFootballMatch apiFootballMatch, int season, int league, int matchday, int matchNo, int status, int koMatch) { this.season = season; this.league = league; this.matchday = matchday; this.matchNo = matchNo; - this.teamIdHome = TeamIDMatcher.getTippligaIdFromOpenLigaDbId(APIFootballMatch.getTeamIdHome()); - this.teamIdGuest = TeamIDMatcher.getTippligaIdFromOpenLigaDbId(APIFootballMatch.getTeamIdGuest()); - this.goalsHome = APIFootballMatch.getGoalsHome(); - this.goalsGuest = APIFootballMatch.getGoalsGuest(); - this.matchDatetime = APIFootballMatch.getMatchDateTime().replace("T", " ").substring(0, 19); + this.teamIdHome = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch.getTeamIdHome()); + this.teamIdGuest = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch.getTeamIdGuest()); + this.goalsHome = apiFootballMatch.getGoalsHome(); + this.goalsGuest = apiFootballMatch.getGoalsGuest(); + this.matchDatetime = apiFootballMatch.getMatchDateTime().replace("T", " ").substring(0, 19); this.groupId = ""; this.formulaHome = ""; this.formulaGuest = ""; @@ -143,6 +143,31 @@ public class TLWMatch extends BaseMatch { this.status = 0; } + public TLWMatch(TLWMatch referenceMatch) { + this.season = referenceMatch.season; + this.league = referenceMatch.league; + this.matchday = referenceMatch.matchday; + this.teamIdHome = referenceMatch.teamIdHome; + this.teamIdGuest = referenceMatch.teamIdGuest; + this.goalsHome = referenceMatch.goalsHome; + this.goalsGuest = referenceMatch.goalsGuest; + this.matchDatetime = referenceMatch.matchDatetime; + this.matchNo = referenceMatch.matchNo; + this.groupId = referenceMatch.groupId; + this.formulaHome = referenceMatch.formulaHome; + this.formulaGuest = referenceMatch.formulaGuest; + this.status = referenceMatch.status; + this.koMatch = referenceMatch.koMatch; + this.goalsOvertimeHome = referenceMatch.goalsOvertimeHome; + this.goalsOvertimeGuest = referenceMatch.goalsOvertimeGuest; + this.showTable = referenceMatch.showTable; + this.trend = referenceMatch.trend; + this.odd1 = referenceMatch.odd1; + this.oddX = referenceMatch.oddX; + this.odd2 = referenceMatch.odd2; + this.rating = referenceMatch.rating; + } + public Integer getSeason() { return this.season; } @@ -229,4 +254,20 @@ public class TLWMatch extends BaseMatch { private String nullToSqlEmptyString(String string) { return string != null ? "'"+string+"'" : "''"; } + + public void setStatus(int status) { + this.status = status; + } + + public void setMatchDateTime(String matchDateTime) { + this.matchDatetime = matchDateTime; + } + + public void updateMatch(APIFootballMatch apiFootballMatch) { + this.teamIdHome = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch.getTeamIdHome()); + this.teamIdGuest = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch.getTeamIdGuest()); + this.goalsHome = apiFootballMatch.getGoalsHome(); + this.goalsGuest = apiFootballMatch.getGoalsGuest(); + this.matchDatetime = apiFootballMatch.getMatchDateTime().replace("T", " ").substring(0, 19); + } } \ No newline at end of file diff --git a/src/main/java/de/jeyp91/tippliga/TLWMatchesManagerBase.java b/src/main/java/de/jeyp91/tippliga/TLWMatchesManagerBase.java index 6be679e..2e946f3 100644 --- a/src/main/java/de/jeyp91/tippliga/TLWMatchesManagerBase.java +++ b/src/main/java/de/jeyp91/tippliga/TLWMatchesManagerBase.java @@ -1,4 +1,3 @@ -<<<<<<< HEAD package de.jeyp91.tippliga; import com.google.common.io.Resources; @@ -59,7 +58,4 @@ public class TLWMatchesManagerBase { } return matchDateTime; } -======= -package de.jeyp91.tippliga;public class TLWMatchesManagerBase { ->>>>>>> origin/master } diff --git a/src/main/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootball.java b/src/main/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootball.java index 81e4fbc..2faee86 100644 --- a/src/main/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootball.java +++ b/src/main/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootball.java @@ -1,11 +1,185 @@ package de.jeyp91.tippliga; -public class TLWFootballMatchesUpdater { - public TLWFootballMatchesUpdater() { +import de.jeyp91.TeamIDMatcher; +import de.jeyp91.apifootball.APIFootballMatch; +import de.jeyp91.apifootball.APIFootballMatchesProvider; +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; +import java.util.ArrayList; +import java.util.Date; + +public class TLWMatchesUpdaterFootball extends TLWMatchesManagerBase { + + ArrayList tlwMatchesOriginal; + ArrayList tlwMatchesUpdated; + + public TLWMatchesUpdaterFootball(int season, int league, String configFileName) throws Exception { + + this.season = season; + this.league = league; + + tlwMatchesOriginal = new ArrayList<>(); + tlwMatchesUpdated = new ArrayList<>(); + + super.initConfigParamsFromFile(configFileName); + this.initUpdates(); + } + + private void initUpdates() throws Exception { + + APIFootballMatchesProvider apiFootballMatchesProvider = new APIFootballMatchesProvider(this.season); + TippligaSQLConnector tippligaSQLConnector = new TippligaSQLConnector(); + for (Object singleMatchdayConfig : this.matchdayConfig) { + int tlwMatchday = ((Long) ((JSONObject) singleMatchdayConfig).get("TLWMatchday")).intValue(); + JSONArray matchesConfig = (JSONArray) ((JSONObject) singleMatchdayConfig).get("matchesConfig"); + + ArrayList apiFootballMatches = apiFootballMatchesProvider.getAPIFootballMatchesFromConfig(matchesConfig); + + ArrayList tlwMatchesOriginalMatchday = tippligaSQLConnector.getMatches(String.valueOf(this.season), String.valueOf(this.league), String.valueOf(tlwMatchday)); + ArrayList tlwMatchesUpdatedMatchday = new ArrayList<>(); + for (TLWMatch match : tlwMatchesOriginalMatchday) tlwMatchesUpdatedMatchday.add(new TLWMatch(match)); + + if (apiFootballMatches.size() > tlwMatchesUpdatedMatchday.size()) { + throw new Exception("Not matching config!"); + } + + addMissingMatches(tlwMatchesUpdatedMatchday, apiFootballMatches); + updateMatchDateTimes(tlwMatchesUpdatedMatchday, apiFootballMatches); + updateStatus(tlwMatchesUpdatedMatchday); + + this.tlwMatchesOriginal.addAll(tlwMatchesOriginalMatchday); + this.tlwMatchesUpdated.addAll(tlwMatchesUpdatedMatchday); + } } public String getUpdateSQL() { - return ""; + return this.getUpdateString(tlwMatchesOriginal, tlwMatchesUpdated); + } + + private String getUpdateString(ArrayList matchesOriginal, ArrayList matchesUpdated) { + String updateString = ""; + for (int i = 0; i < matchesOriginal.size(); i++) { + updateString += getUpdateString(matchesOriginal.get(i), matchesUpdated.get(i)); + } + return updateString; + } + + private String getUpdateString(TLWMatch matchOriginal, TLWMatch matchUpdated) { + String updateString = ""; + String updateStart = "UPDATE phpbb_footb_matches SET "; + String condition = "WHERE season = " + matchOriginal.getSeason() + " " + + "AND league = " + matchOriginal.getLeague() + " " + + "AND matchday = " + matchOriginal.getMatchday() + " " + + "AND match_no = " + matchOriginal.getMatchNo() + ";\n"; + + if(matchOriginal.getTeamIdHome() != matchUpdated.getTeamIdHome()) { + updateString += updateStart + + "team_id_home = " + matchUpdated.getTeamIdHome() + " " + + condition; + } + + if(matchOriginal.getTeamIdGuest() != matchUpdated.getTeamIdGuest()) { + updateString += updateStart + + "team_id_guest = " + matchUpdated.getTeamIdGuest() + " " + + condition; + } + + if (!matchOriginal.getMatchDateTime().equals(matchUpdated.getMatchDateTime())) { + updateString += updateStart + + "match_datetime = '" + matchUpdated.getMatchDateTime() + "' " + + condition; + } + + if (!matchOriginal.getStatus().equals(matchUpdated.getStatus())) { + updateString += updateStart + + "status = '" + matchUpdated.getStatus() + "' " + + condition; + } + + + return updateString; + } + + private void addMissingMatches(ArrayList tlwMatches, + ArrayList apiFootballMatches) throws Exception { + + ArrayList missingMatches = new ArrayList<>(); + + for(APIFootballMatch apiFootballMatch : apiFootballMatches) { + if(getMatchingMatch(apiFootballMatch, tlwMatches) == null) { + missingMatches.add(apiFootballMatch); + } + } + + for (APIFootballMatch missingMatch : missingMatches) { + boolean done = false; + for(TLWMatch tlwMatch : tlwMatches) { + if(tlwMatch.getTeamIdHome() == 0 && tlwMatch.getTeamIdGuest() == 0) { + tlwMatch.updateMatch(missingMatch); + done = true; + break; + } + } + if(!done) { + throw new Exception("Could not add missing match"); + } + } + } + + private void updateMatchDateTimes( + ArrayList tlwMatches, + ArrayList apiFootballMatches) throws Exception + { + for(APIFootballMatch apiFootballMatch : apiFootballMatches) { + TLWMatch tlwMatch = getMatchingMatch(apiFootballMatch, tlwMatches); + tlwMatch.setMatchDateTime(apiFootballMatch.getMatchDateTime().replace("T", " ").substring(0, 19)); + } + } + + private void updateStatus(ArrayList matches) { + Date earliestDate = getEarliestMatchDateTime(matches); + Date now = new Date(System.currentTimeMillis()); + if(earliestDate.after(now)) { + for(TLWMatch match : matches) { + Date date = this.getDateObject(match.getMatchDateTime()); + if (this.getDaysDifference(earliestDate, date) == 0) { + match.setStatus(0); + } else { + match.setStatus(-1); + } + } + } + } + + private Date getEarliestMatchDateTime(ArrayList matches) { + Date earliestDate = this.getDateObject(matches.get(0).getMatchDateTime()); + for(TLWMatch match : matches) { + Date date = this.getDateObject(match.getMatchDateTime()); + if(date.before(earliestDate)) { + earliestDate = date; + } + } + return earliestDate; + } + + private TLWMatch getMatchingMatch(APIFootballMatch apiFootballMatch, ArrayList tlwMatches) throws Exception { + int foundMatches = 0; + TLWMatch matchingMatch = null; + for(TLWMatch match : tlwMatches) { + int apiTeamIdHome = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch.getTeamIdHome()); + int apiTeamIdGuest = TeamIDMatcher.getTippligaIdFromApiFootballId(apiFootballMatch.getTeamIdGuest()); + if( + apiTeamIdHome == match.getTeamIdHome() + && apiTeamIdGuest == match.getTeamIdGuest() + ) { + foundMatches++; + matchingMatch = match; + } + } + if(foundMatches > 1) { + throw new Exception("Found more than one matching matches"); + } + return matchingMatch; } } diff --git a/src/main/java/de/jeyp91/tippliga/TLWTeam.java b/src/main/java/de/jeyp91/tippliga/TLWTeam.java index 56c280f..0617552 100644 --- a/src/main/java/de/jeyp91/tippliga/TLWTeam.java +++ b/src/main/java/de/jeyp91/tippliga/TLWTeam.java @@ -42,6 +42,21 @@ public class TLWTeam { } } + public TLWTeam( + int season, int league, int teamId, + String teamName, String teamNameShort, String teamSymbol, String groupId, + int matchday + ) { + this.season = season; + this.league = league; + this.teamId = teamId; + this.teamName = teamName; + this.teamNameShort = teamNameShort; + this.teamSymbol = teamSymbol; + this.groupId = groupId; + this.matchday = matchday; + } + public int getSeason() { return this.season; } diff --git a/src/main/java/de/jeyp91/tippliga/TLWTeamsCreator.java b/src/main/java/de/jeyp91/tippliga/TLWTeamsCreator.java index 71cd2ab..d59fe2c 100644 --- a/src/main/java/de/jeyp91/tippliga/TLWTeamsCreator.java +++ b/src/main/java/de/jeyp91/tippliga/TLWTeamsCreator.java @@ -33,7 +33,7 @@ public class TLWTeamsCreator { Set teamIds = getTeamIds(); String sql = ""; for (Integer id : teamIds) { - ArrayList teams = connector.getTeamsById(String.valueOf(id)); + ArrayList teams = connector.getTeams(String.valueOf(id)); String teamName = teams.get(0).getTeamName(); String teamNameShort = teams.get(0).getTeamNameShort(); String teamSymbol = teams.get(0).getTeamSymbol(); diff --git a/src/main/java/de/jeyp91/tippliga/TLWTeamsUpdater.java b/src/main/java/de/jeyp91/tippliga/TLWTeamsUpdater.java index 2bb991c..45ab64f 100644 --- a/src/main/java/de/jeyp91/tippliga/TLWTeamsUpdater.java +++ b/src/main/java/de/jeyp91/tippliga/TLWTeamsUpdater.java @@ -1,4 +1,3 @@ -<<<<<<< HEAD package de.jeyp91.tippliga; import java.util.ArrayList; @@ -87,7 +86,4 @@ public class TLWTeamsUpdater { return updateSql; } -======= -package de.jeyp91.tippliga;public class TLWTeamsUpdater { ->>>>>>> origin/master } diff --git a/src/main/java/de/jeyp91/tippliga/TippligaSQLConnector.java b/src/main/java/de/jeyp91/tippliga/TippligaSQLConnector.java index e0c6e45..277f07a 100644 --- a/src/main/java/de/jeyp91/tippliga/TippligaSQLConnector.java +++ b/src/main/java/de/jeyp91/tippliga/TippligaSQLConnector.java @@ -33,23 +33,33 @@ public class TippligaSQLConnector { } } - public ArrayList getTeamsBySeasonAndLeague(String season, String league) { + public ArrayList getTeams(String season, String league) { String queryString = "SELECT * FROM `phpbb_footb_teams` WHERE `season` = " + season + " AND `league` = " + league + ";"; ArrayList teams = new ArrayList<>(); - for (ResultSet rset : executeQuery(queryString)) { - teams.add(new TLWTeam(rset)); + ResultSet rset = executeQuery(queryString); + try { + while (rset.next()) { + teams.add(new TLWTeam(rset)); + } + } catch (SQLException throwables) { + throwables.printStackTrace(); } return teams; } - public ArrayList getTeamsById(String id) { - String queryString = "SELECT * FROM `phpbb_footb_teams` WHERE `team_id` = " + id + " ORDER BY `season` DESC;"; + public ArrayList getTeams(String id) { + String queryString = "SELECT * FROM `phpbb_footb_teams` WHERE `team_id` = " + id + " ORDER BY `season` DESC, `league` ASC;"; ArrayList teams = new ArrayList<>(); - for (ResultSet rset : executeQuery(queryString)) { - teams.add(new TLWTeam(rset)); + ResultSet rset = executeQuery(queryString); + try { + while (rset.next()) { + teams.add(new TLWTeam(rset)); + } + } catch (SQLException throwables) { + throwables.printStackTrace(); } return teams; @@ -58,8 +68,13 @@ public class TippligaSQLConnector { private ArrayList getMatches(String queryString) { ArrayList matches = new ArrayList<>(); - for (ResultSet rset : executeQuery(queryString)) { - matches.add(new TLWMatch(rset)); + ResultSet rset = executeQuery(queryString); + try { + while (rset.next()) { + matches.add(new TLWMatch(rset)); + } + } catch (SQLException throwables) { + throwables.printStackTrace(); } return matches; } @@ -70,7 +85,7 @@ public class TippligaSQLConnector { } public ArrayList getMatches(String season, String league, String matchday) { - String queryString = "SELECT * FROM `phpbb_footb_matches` WHERE `season` = " + season + " AND `league` = " + league + "AND `matchday` = " + matchday + ";"; + String queryString = "SELECT * FROM `phpbb_footb_matches` WHERE `season` = " + season + " AND `league` = " + league + " AND `matchday` = " + matchday + ";"; return getMatches(queryString); } @@ -83,19 +98,15 @@ public class TippligaSQLConnector { executeQuery(queryString); } - private ArrayList executeQuery (String queryString){ + private ResultSet executeQuery (String queryString){ Statement stmt; - ResultSet rset; - ArrayList results = new ArrayList<>(); + ResultSet rset = null; try { stmt = con.createStatement(); rset = stmt.executeQuery(queryString); - while (rset.next()) { - results.add(rset); - } } catch (SQLException throwables) { throwables.printStackTrace(); } - return results; + return rset; } } diff --git a/src/main/resources/Team_ID_TLW_APIF_config.json b/src/main/resources/Team_ID_TLW_APIF_config.json index 29a2033..ec6935b 100644 --- a/src/main/resources/Team_ID_TLW_APIF_config.json +++ b/src/main/resources/Team_ID_TLW_APIF_config.json @@ -408,5 +408,15 @@ "teamname": "1. FC Düren", "tippligaID": 182, "apiFootballID": 12754 + }, + { + "teamname": "Olymp. Lyon", + "tippligaID": 505, + "apiFootballID": 80 + }, + { + "teamname": "AS Monaco", + "tippligaID": 160, + "apiFootballID": 91 } ] \ No newline at end of file diff --git a/src/test/java/de/jeyp91/TeamIDMatcherTest.java b/src/test/java/de/jeyp91/TeamIDMatcherTest.java index 415d753..8951bd3 100644 --- a/src/test/java/de/jeyp91/TeamIDMatcherTest.java +++ b/src/test/java/de/jeyp91/TeamIDMatcherTest.java @@ -7,25 +7,25 @@ public class TeamIDMatcherTest { @Test public void getOpenLigaDbIdFromTippligaIdTest() { - int openligaDBID; + int apiFootballId; - openligaDBID = TeamIDMatcher.getOpenLigaDbIdFromTippligaId(1); - assertEquals(40, openligaDBID); - openligaDBID = TeamIDMatcher.getOpenLigaDbIdFromTippligaId(16); - assertEquals(54, openligaDBID); - openligaDBID = TeamIDMatcher.getOpenLigaDbIdFromTippligaId(12); - assertEquals(7, openligaDBID); + apiFootballId = TeamIDMatcher.getApiFootballIdFromTippligaId(505); + assertEquals(80, apiFootballId); + apiFootballId = TeamIDMatcher.getApiFootballIdFromTippligaId(160); + assertEquals(91, apiFootballId); + apiFootballId = TeamIDMatcher.getApiFootballIdFromTippligaId(182); + assertEquals(12754, apiFootballId); } @Test public void getTippligaIdFromOpenLigaDbIdTest() { - int openligaDBID; + int tlwId; - openligaDBID = TeamIDMatcher.getTippligaIdFromOpenLigaDbId(40); - assertEquals(1, openligaDBID); - openligaDBID = TeamIDMatcher.getTippligaIdFromOpenLigaDbId(54); - assertEquals(16, openligaDBID); - openligaDBID = TeamIDMatcher.getTippligaIdFromOpenLigaDbId(7); - assertEquals(12, openligaDBID); + tlwId = TeamIDMatcher.getTippligaIdFromApiFootballId(80); + assertEquals(505, tlwId); + tlwId = TeamIDMatcher.getTippligaIdFromApiFootballId(91); + assertEquals(160, tlwId); + tlwId = TeamIDMatcher.getTippligaIdFromApiFootballId(12754); + assertEquals(182, tlwId); } } diff --git a/src/test/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootballTest.java b/src/test/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootballTest.java index c8e4fa3..169e609 100644 --- a/src/test/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootballTest.java +++ b/src/test/java/de/jeyp91/tippliga/TLWMatchesUpdaterFootballTest.java @@ -1,4 +1,3 @@ -<<<<<<< HEAD package de.jeyp91.tippliga; import org.junit.Test; @@ -12,7 +11,4 @@ public class TLWMatchesUpdaterFootballTest { System.out.println(sql); } -======= -package de.jeyp91.tippliga;public class TLWMatchesUpdaterFootball { ->>>>>>> origin/master } diff --git a/src/test/java/de/jeyp91/tippliga/TLWTeamsUpdaterTest.java b/src/test/java/de/jeyp91/tippliga/TLWTeamsUpdaterTest.java index a300320..3fb6348 100644 --- a/src/test/java/de/jeyp91/tippliga/TLWTeamsUpdaterTest.java +++ b/src/test/java/de/jeyp91/tippliga/TLWTeamsUpdaterTest.java @@ -1,4 +1,3 @@ -<<<<<<< HEAD package de.jeyp91.tippliga; import org.junit.Test; @@ -14,8 +13,4 @@ public class TLWTeamsUpdaterTest { System.out.println(sql); } - -======= -package de.jeyp91.tippliga;public class TLWTeamsUpdaterTest { ->>>>>>> origin/master } diff --git a/src/test/java/de/jeyp91/tippliga/TippligaSQLConnectorTest.java b/src/test/java/de/jeyp91/tippliga/TippligaSQLConnectorTest.java index a36828c..da1bfe1 100644 --- a/src/test/java/de/jeyp91/tippliga/TippligaSQLConnectorTest.java +++ b/src/test/java/de/jeyp91/tippliga/TippligaSQLConnectorTest.java @@ -18,7 +18,7 @@ public class TippligaSQLConnectorTest { @Test public void getTeamsBySeasonAndLeagueTest() { - ArrayList teams = tl.getTeamsBySeasonAndLeague("2020", "1"); + ArrayList teams = tl.getTeams("2020", "1"); assertEquals(84, teams.size()); @@ -34,11 +34,9 @@ public class TippligaSQLConnectorTest { @Test public void getTeamsByIdTest() { - ArrayList teams = tl.getTeamsById("1"); + ArrayList teams = tl.getTeams("1"); - assertEquals(39, teams.size()); - - assertEquals(2011, teams.get(0).getSeason()); + assertEquals(2021, teams.get(0).getSeason()); assertEquals(1, teams.get(0).getLeague()); assertEquals(1, teams.get(0).getTeamId()); assertEquals("Bayern München", teams.get(0).getTeamName()); diff --git a/tokens/StoredCredential b/tokens/StoredCredential index aeb6ba67707717732ebdbc155e62587ec4255cd4..43f675557c9b9dfa12c5fcdcfca8cbcc2b4b717e 100644 GIT binary patch delta 191 zcmdnVv6Ev%1Y^C6V~9zBqlLd^Vn(H(pNE@EVnk_0LAps*Mt-5LuVHCqdTFwohnbN} zQc8Y)fV)XzfVqWpzMpZjS8BeuVYWx5Z@I3IPf%cRrFVv(u4hzUT4yH9qwWm$Qd zxnX)vm``qnX-Y6lV^p$pijR4wyN^Y2j&G7%TDd~FXI6-#qeW$oSEZ-3K~aFI rsh?-KdsR_oO1Ocut69b5?~GoY#ea7^NGmR4(3t$6Nn>*n({V-sF(E=I