예제 #1
0
  @Test
  public void shouldReturnAllPlayers() {
    final List<Player> players = playerDao.getAll();

    assertNotNull(players);
    assertEquals(3, players.size());
  }
예제 #2
0
  @Test
  public void shoudReturnAPlayerById() {
    final List<Player> players = playerDao.getAll();

    assertNotNull(players);
    assertFalse(players.isEmpty());

    final Player player = players.get(0);
    final Player playerById = playerDao.getById(player.getPlayerId(), player.getTeamId());

    assertNotNull(playerById);
    assertEquals(player.getPlayerId(), playerById.getPlayerId());
    assertEquals(player.getAge(), playerById.getAge());
    assertEquals(player.getGoals(), playerById.getGoals());
    assertEquals(player.getCountry(), playerById.getCountry());
    assertEquals(player.getName(), playerById.getName());
    assertEquals(player.getTeamId(), playerById.getTeamId());
  }
예제 #3
0
 private void deletePlayerAndValidateDeletion(Player player) {
   playerDao.delete(player.getPlayerId());
   assertNull(playerDao.getById(player.getPlayerId(), player.getTeamId()));
   assertEquals(3, playerDao.getAll().size());
 }