### Question:
JooqFightDAO extends AbstractJooqDAO implements FightDAO { @Override public List<FightWithPlanetAndPlayer> findFightsWithPlayerSinceRound(UUID playerId, long round) { Preconditions.checkNotNull(playerId, "playerId"); LOGGER.debug("Finding all fights with player {} since round {}", playerId, round); Map<UUID, Result<Record>> result = selectFromFights() .where(FIGHT.ATTACKER_ID.eq(playerId).or(FIGHT.DEFENDER_ID.eq(playerId))) .and(FIGHT.ROUND.greaterOrEqual(round)) .fetchGroups(FIGHT.ID); return readFights(result); } @Inject  JooqFightDAO(UnitOfWorkService unitOfWorkService); @Override Optional<FightWithPlanetAndPlayer> findWithId(UUID id); @Override void insert(Fight fight); @Override List<FightWithPlanetAndPlayer> findFightsWithPlayerSinceRound(UUID playerId, long round); static final Player ATTACKER_ALIAS; static final Player DEFENDER_ALIAS; }### Answer:
@Test public void testFindFightsWithPlayerSinceRound2() throws Exception { Fight expected = FightScenario.Player1.FIGHT; List<FightWithPlanetAndPlayer> fight = sut.findFightsWithPlayerSinceRound(expected.getDefenderId(), expected.getRound()); assertThat(fight, hasSize(1)); assertThat(fight.get(0), is(new FightWithPlanetAndPlayer(expected, BasicScenario.Player2.Planet1.PLANET, BasicScenario.Player1.PLAYER, BasicScenario.Player2.PLAYER))); }
@Test public void testFindFightsWithPlayerSinceRound3() throws Exception { List<FightWithPlanetAndPlayer> fight = sut.findFightsWithPlayerSinceRound(FightScenario.Player1.FIGHT.getAttackerId(), 100); assertThat(fight, hasSize(0)); }
@Test public void testFindFightsWithPlayerSinceRound4() throws Exception { List<FightWithPlanetAndPlayer> fight = sut.findFightsWithPlayerSinceRound(UUID.randomUUID(), 100); assertThat(fight, hasSize(0)); }
@Test public void testFindFightsWithPlayerSinceRound() throws Exception { Fight expected = FightScenario.Player1.FIGHT; List<FightWithPlanetAndPlayer> fight = sut.findFightsWithPlayerSinceRound(expected.getAttackerId(), expected.getRound()); assertThat(fight, hasSize(1)); assertThat(fight.get(0), is(new FightWithPlanetAndPlayer(expected, BasicScenario.Player2.Planet1.PLANET, BasicScenario.Player1.PLAYER, BasicScenario.Player2.PLAYER))); }