@Test public void deleteHiveDestination() throws Exception { destinations.put("hive", hiveDestination); road.setDestinations(destinations); store.put(NAME, road); underTest.deleteHiveDestination(NAME); assertNull(store.get(NAME).getDestinations().get("hive")); }
@Override public void deleteHiveDestination(String name) throws UnknownRoadException, UnknownDestinationException { getHiveDestination(name).orElseThrow(() -> new UnknownDestinationException("Hive", name)); List<PatchOperation> operations = new ArrayList<>(); operations.add(PatchOperation.remove(DESTINATIONS_HIVE)); PatchSet patchSet = new PatchSet(name, operations); modificationEmitter.emit(patchSet); }
TollBoothHiveDestinationAdminClient implements HiveDestinationAdminClient { @Override public void deleteHiveDestination(String name) throws UnknownRoadException, UnknownDestinationException { getHiveDestination(name).orElseThrow(() -> new UnknownDestinationException("Hive", name)); List<PatchOperation> operations = new ArrayList<>(); operations.add(PatchOperation.remove(DESTINATIONS_HIVE)); PatchSet patchSet = new PatchSet(name, operations); modificationEmitter.emit(patchSet); } }
TollBoothHiveDestinationAdminClient implements HiveDestinationAdminClient { @Override public void deleteHiveDestination(String name) throws UnknownRoadException, UnknownDestinationException { getHiveDestination(name).orElseThrow(() -> new UnknownDestinationException("Hive", name)); List<PatchOperation> operations = new ArrayList<>(); operations.add(PatchOperation.remove(DESTINATIONS_HIVE)); 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 deleteHiveDestination(String name) throws UnknownRoadException, UnknownDestinationException { getHiveDestination(name).orElseThrow(() -> new UnknownDestinationException("Hive", name)); List<PatchOperation> operations = new ArrayList<>(); operations.add(PatchOperation.remove(DESTINATIONS_HIVE)); 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 deleteHiveDestination(String name) throws UnknownRoadException, UnknownDestinationException { getHiveDestination(name).orElseThrow(() -> new UnknownDestinationException("Hive", name)); List<PatchOperation> operations = new ArrayList<>(); operations.add(PatchOperation.remove(DESTINATIONS_HIVE)); 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);  }