@Test(expected = UnknownDestinationException.class) public void updateHiveDestination_UnknownDestination() throws Exception { store.put(NAME, road); underTest.updateHiveDestination(NAME, hiveDestination); }
@Override public void updateHiveDestination(String name, HiveDestination hiveDestination) throws UnknownRoadException, UnknownDestinationException { getHiveDestination(name).orElseThrow(() -> new UnknownDestinationException("Hive", name)); List<PatchOperation> operations = Collections .singletonList(PatchOperation.replace(DESTINATIONS_HIVE, hiveDestination)); PatchSet patchSet = new PatchSet(name, operations); modificationEmitter.emit(patchSet); }
TollBoothHiveDestinationAdminClient implements HiveDestinationAdminClient { @Override public void updateHiveDestination(String name, HiveDestination hiveDestination) throws UnknownRoadException, UnknownDestinationException { getHiveDestination(name).orElseThrow(() -> new UnknownDestinationException("Hive", name)); List<PatchOperation> operations = Collections .singletonList(PatchOperation.replace(DESTINATIONS_HIVE, hiveDestination)); PatchSet patchSet = new PatchSet(name, operations); modificationEmitter.emit(patchSet); } }
TollBoothHiveDestinationAdminClient implements HiveDestinationAdminClient { @Override public void updateHiveDestination(String name, HiveDestination hiveDestination) throws UnknownRoadException, UnknownDestinationException { getHiveDestination(name).orElseThrow(() -> new UnknownDestinationException("Hive", name)); List<PatchOperation> operations = Collections .singletonList(PatchOperation.replace(DESTINATIONS_HIVE, hiveDestination)); PatchSet patchSet = new PatchSet(name, operations); modificationEmitter.emit(patchSet); } @Autowired  TollBoothHiveDestinationAdminClient(
      @Value("#{store}") Map<String, Road> roads,
      PatchSetEmitter modificationEmitter); }
TollBoothHiveDestinationAdminClient implements HiveDestinationAdminClient { @Override public void updateHiveDestination(String name, HiveDestination hiveDestination) throws UnknownRoadException, UnknownDestinationException { getHiveDestination(name).orElseThrow(() -> new UnknownDestinationException("Hive", name)); List<PatchOperation> operations = Collections .singletonList(PatchOperation.replace(DESTINATIONS_HIVE, hiveDestination)); PatchSet patchSet = new PatchSet(name, operations); modificationEmitter.emit(patchSet); } @Autowired  TollBoothHiveDestinationAdminClient(
      @Value("#{store}") Map<String, Road> roads,
      PatchSetEmitter modificationEmitter); @Override Optional<HiveDestination> getHiveDestination(String name); @Override void createHiveDestination(String name, HiveDestination hiveDestination); @Override void deleteHiveDestination(String name); @Override void updateHiveDestination(String name, HiveDestination hiveDestination); }
TollBoothHiveDestinationAdminClient implements HiveDestinationAdminClient { @Override public void updateHiveDestination(String name, HiveDestination hiveDestination) throws UnknownRoadException, UnknownDestinationException { getHiveDestination(name).orElseThrow(() -> new UnknownDestinationException("Hive", name)); List<PatchOperation> operations = Collections .singletonList(PatchOperation.replace(DESTINATIONS_HIVE, hiveDestination)); PatchSet patchSet = new PatchSet(name, operations); modificationEmitter.emit(patchSet); } @Autowired  TollBoothHiveDestinationAdminClient(
      @Value("#{store}") Map<String, Road> roads,
      PatchSetEmitter modificationEmitter); @Override Optional<HiveDestination> getHiveDestination(String name); @Override void createHiveDestination(String name, HiveDestination hiveDestination); @Override void deleteHiveDestination(String name); @Override void updateHiveDestination(String name, HiveDestination hiveDestination);  }