final List<Team> teams = new ArrayList<Team>();
Team team = createTeam("Olympique Marseille", 1);
teams.add(team);
final Date matchDay1 = Calendar.getInstance().getTime();
final StandingsHistory standingsHistory1 = createStandingsHistory(team, matchDay1);
final Calendar matchDay2 = Calendar.getInstance();
matchDay2.set(Calendar.DAY_OF_MONTH, -1);
final StandingsHistory standingsHistory2 = createStandingsHistory(team, matchDay2.getTime());
em.getTransaction().begin();
teamService.insertTeams(teams);
standingsHistoryService.insertStandingsHistory(standingsHistory1);
standingsHistoryService.insertStandingsHistory(standingsHistory2);
em.getTransaction().commit();
StandingsHistory result = standingsHistoryService.findStandingsHistoryByTeamAndDate(team, standingsHistory1.getMatchDay());
Assert.assertEquals(team, result.getTeam());
result = standingsHistoryService.findStandingsHistoryByTeamAndDate(team, standingsHistory2.getMatchDay());
Assert.assertEquals(team, result.getTeam());
// DELETE
em.getTransaction().begin();
standingsHistoryService.removeAllStandingsHistory();
em.getTransaction().commit();