### Question:
JooqHangarDAO extends AbstractJooqDAO implements HangarDAO { @Override public void update(Hangar hangar) { Preconditions.checkNotNull(hangar, "hangar"); LOGGER.debug("Updating hangar {}", hangar); context() .update(HANGAR) .set(HANGAR.PLANET_ID, hangar.getPlanetId()) .set(HANGAR.PLAYER_ID, hangar.getPlayerId()) .where(HANGAR.ID.eq(hangar.getId())) .execute(); context() .delete(HANGAR_SHIPS) .where(HANGAR_SHIPS.HANGAR_ID.eq(hangar.getId())) .execute(); insertShips(hangar); } @Inject  JooqHangarDAO(UnitOfWorkService unitOfWorkService); @Override Optional<Hangar> findWithPlanetId(UUID planetId); @Override void update(Hangar hangar); @Override void insert(Hangar hangar);  }### Answer:
@Test public void testUpdate() throws Exception { Hangar hangar = BasicScenario.Player1.Planet1.HANGAR; Hangar updatedHangar = new Hangar(hangar.getId(), hangar.getPlanetId(), hangar.getPlayerId(), Ships.EMPTY); sut.update(updatedHangar); List<Map<String, Object>> hangarRows = select("SELECT * FROM hangar WHERE id = ?", updatedHangar.getId()); assertThat(hangarRows, hasSize(1)); verifyHangarRow(hangarRows.get(0), updatedHangar); List<Map<String, Object>> hangarShipsRows = select("SELECT * FROM hangar_ships WHERE hangar_id = ?", updatedHangar.getId()); assertThat(hangarShipsRows, hasSize(0)); }