### Question:
VehicleJdbcGateway implements VehicleGateway { @Override public Vehicle save(final Vehicle vehicle) { jdbcTemplate.update( "INSERT INTO RENT_A_CAR.VEHICLE (ID, TYPE, BRAND, MODEL, RATE, LOCATION) VALUES (?, ?, ?, ?, ?, ?)", vehicle.getId(), vehicle.getType().getType(), vehicle.getBrand().getName(), vehicle.getModel().getName(), vehicle.getRate(), vehicle.getLocation()); return vehicle; } VehicleJdbcGateway(final JdbcTemplate jdbcTemplate); @Override Vehicle save(final Vehicle vehicle); @Override Optional<Vehicle> findById(final String id); @Override List<Vehicle> search(final String type, final String brand, final String model,
        final BigDecimal maximumRate);  }### Answer:
@Test void test_save_vehicle_saves() { final Vehicle vehicle = setupVehicle(); vehicleGateway.save(vehicle); Assertions.assertNotNull(vehicle); }
@Test void test_save_duplicateId_doesNotSave() { final Vehicle vehicle = setupVehicle(); vehicleGateway.save(vehicle); Assertions.assertThrows(DuplicateKeyException.class, () -> vehicleGateway.save(vehicle)); }
@Test void test_save_typeDoesNotExist_doesNotSave() { final Vehicle vehicle = setupVehicle(); vehicleGateway.save(vehicle); Assertions.assertThrows(DuplicateKeyException.class, () -> vehicleGateway.save(vehicle)); }