### Question:
LocationJdbcGateway implements LocationGateway { @Override public Location save(final Location location) { jdbcTemplate.update("INSERT INTO RENT_A_CAR.LOCATION (NAME, ADDRESS) VALUES (?, ?)", location.getName(), location.getAddress()); return location; } LocationJdbcGateway(final JdbcTemplate jdbcTemplate); @Override Location save(final Location location); @Override Optional<Location> findByName(final String name); @Override Iterable<Location> findAll();  }### Answer:
@Test void test_save_noAddress_saves() { final Location location = new Location(); location.setName("Location 1"); locationGateway.save(location); Assertions.assertNotNull(location); }
@Test void test_save_duplicateName_doesNotSave() { final Location location = new Location(); location.setName("Location 1"); locationGateway.save(location); Assertions.assertThrows(DuplicateKeyException.class, () -> locationGateway.save(location)); }
@Test void test_save_address_saves() { final Location location = new Location(); location.setName("Location 1"); location.setAddress("Address 1"); locationGateway.save(location); Assertions.assertNotNull(location); }