### Question:
JooqFlightDAO extends AbstractJooqDAO implements FlightDAO { @Override public void update(Flight flight) { Preconditions.checkNotNull(flight, "flight"); LOGGER.debug("Updating flight {}", flight); context() .update(FLIGHT) .set(FLIGHT.PLAYER_ID, flight.getPlayerId()) .set(FLIGHT.START_GALAXY, flight.getStart().getGalaxy()) .set(FLIGHT.START_SOLAR_SYSTEM, flight.getStart().getSolarSystem()) .set(FLIGHT.START_PLANET, flight.getStart().getPlanet()) .set(FLIGHT.DESTINATION_GALAXY, flight.getDestination().getGalaxy()) .set(FLIGHT.DESTINATION_SOLAR_SYSTEM, flight.getDestination().getSolarSystem()) .set(FLIGHT.DESTINATION_PLANET, flight.getDestination().getPlanet()) .set(FLIGHT.STARTED_IN_ROUND, flight.getStartedInRound()) .set(FLIGHT.ARRIVAL_IN_ROUND, flight.getArrivalInRound()) .set(FLIGHT.ENERGY_NEEDED, flight.getEnergyNeeded()) .set(FLIGHT.TYPE, flight.getType().getId()) .set(FLIGHT.DIRECTION, flight.getDirection().getId()) .set(FLIGHT.CARGO_CRYSTALS, flight.getCargo().getCrystals()) .set(FLIGHT.CARGO_GAS, flight.getCargo().getGas()) .set(FLIGHT.SPEED, flight.getSpeed()) .set(FLIGHT.DETECTED, flight.isDetected()) .where(FLIGHT.ID.eq(flight.getId())) .execute(); deleteShips(flight); insertShips(flight); } @Inject  JooqFlightDAO(UnitOfWorkService unitOfWorkService); @Override void insert(Flight flight); @Override List<Flight> findWithPlayerId(UUID playerId); @Override List<Flight> findWithArrival(long arrival); @Override void update(Flight flight); @Override void delete(Flight flight); @Override List<Flight> findWithTypeAndDetected(FlightType type, boolean detected); @Override List<Flight> findWithStart(Location location);  }### Answer:
@Test public void testUpdate() throws Exception { Flight flight = FlightScenario.Player1.FLIGHT_1; Flight updatedFlight = new Flight(flight.getId(), new Location(4, 4, 4), new Location(5, 5, 5), 12, 15, new Ships(new Ship(ShipType.DAEDALUS, 7), new Ship(ShipType.MULE, 2)), 12, FlightType.TRANSPORT, BasicScenario.Player2.PLAYER.getId(), FlightDirection.RETURN, new Resources(12, 24, 0), 3.5, true); sut.update(updatedFlight); List<Map<String, Object>> flightRows = select("SELECT * FROM flight WHERE id = ?", updatedFlight.getId()); assertThat(flightRows, hasSize(1)); verifyFlightRow(flightRows.get(0), updatedFlight); List<Map<String, Object>> flightShipsRows = select("SELECT * FROM flight_ships WHERE flight_id = ?", updatedFlight.getId()); assertThat(flightShipsRows, hasSize(2)); verifyFlightShipsRows(flightShipsRows, updatedFlight.getShips()); }