### Question:
JooqFlightDAO extends AbstractJooqDAO implements FlightDAO { @Override public void insert(Flight flight) { Preconditions.checkNotNull(flight, "flight"); LOGGER.debug("Inserting flight {}", flight); context() .insertInto( FLIGHT, FLIGHT.ID, FLIGHT.PLAYER_ID, FLIGHT.START_GALAXY, FLIGHT.START_SOLAR_SYSTEM, FLIGHT.START_PLANET, FLIGHT.DESTINATION_GALAXY, FLIGHT.DESTINATION_SOLAR_SYSTEM, FLIGHT.DESTINATION_PLANET, FLIGHT.STARTED_IN_ROUND, FLIGHT.ARRIVAL_IN_ROUND, FLIGHT.ENERGY_NEEDED, FLIGHT.TYPE, FLIGHT.DIRECTION, FLIGHT.CARGO_CRYSTALS, FLIGHT.CARGO_GAS, FLIGHT.SPEED, FLIGHT.DETECTED ) .values( flight.getId(), flight.getPlayerId(), flight.getStart().getGalaxy(), flight.getStart().getSolarSystem(), flight.getStart().getPlanet(), flight.getDestination().getGalaxy(), flight.getDestination().getSolarSystem(), flight.getDestination().getPlanet(), flight.getStartedInRound(), flight.getArrivalInRound(), flight.getEnergyNeeded(), flight.getType().getId(), flight.getDirection().getId(), flight.getCargo().getCrystals(), flight.getCargo().getGas(), flight.getSpeed(), flight.isDetected() ) .execute(); 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 testInsert() throws Exception { Flight flight = new Flight(UUID.fromString("906e12d0-a99d-11e4-bcd8-0800200c9a66"), new Location(1, 2, 3), new Location(3, 2, 1), 10, 12, new Ships(new Ship(ShipType.DAEDALUS, 7), new Ship(ShipType.PROBE, 1)), 100, FlightType.TRANSFER, BasicScenario.Player1.PLAYER.getId(), FlightDirection.RETURN, new Resources(100, 200, 0), 0.7, true); sut.insert(flight); List<Map<String, Object>> flightRows = select("SELECT * FROM flight WHERE id = ?", flight.getId()); assertThat(flightRows, hasSize(1)); verifyFlightRow(flightRows.get(0), flight); List<Map<String, Object>> flightShipsRows = select("SELECT * FROM flight_ships WHERE flight_id = ?", flight.getId()); assertThat(flightShipsRows, hasSize(2)); verifyFlightShipsRows(flightShipsRows, flight.getShips()); }