@Test public void updateHiveDestination() throws Exception { when(hiveDestinationAdminClient.getHiveDestination(NAME)).thenReturn(Optional.of(hiveDestination)); underTest.updateHiveDestination(NAME, hiveDestinationModel); verify(hiveDestinationAdminClient).updateHiveDestination(NAME, hiveDestination); }
@Override public void updateHiveDestination(String name, HiveDestinationModel hiveDestinationModel) throws UnknownRoadException, UnknownDestinationException { HiveDestination hiveDestination = hiveDestinationAdminClient.getHiveDestination(name).orElseThrow( () -> new UnknownDestinationException("Hive", name)); hiveDestination.setLandingInterval(validateAndNormaliseLandingInterval(hiveDestinationModel.getLandingInterval())); hiveDestination.setEnabled(hiveDestinationModel.isEnabled()); hiveDestinationAdminClient.updateHiveDestination(name, hiveDestination); }
HiveDestinationServiceImpl implements HiveDestinationService { @Override public void updateHiveDestination(String name, HiveDestinationModel hiveDestinationModel) throws UnknownRoadException, UnknownDestinationException { HiveDestination hiveDestination = hiveDestinationAdminClient.getHiveDestination(name).orElseThrow( () -> new UnknownDestinationException("Hive", name)); hiveDestination.setLandingInterval(validateAndNormaliseLandingInterval(hiveDestinationModel.getLandingInterval())); hiveDestination.setEnabled(hiveDestinationModel.isEnabled()); hiveDestinationAdminClient.updateHiveDestination(name, hiveDestination); } }
HiveDestinationServiceImpl implements HiveDestinationService { @Override public void updateHiveDestination(String name, HiveDestinationModel hiveDestinationModel) throws UnknownRoadException, UnknownDestinationException { HiveDestination hiveDestination = hiveDestinationAdminClient.getHiveDestination(name).orElseThrow( () -> new UnknownDestinationException("Hive", name)); hiveDestination.setLandingInterval(validateAndNormaliseLandingInterval(hiveDestinationModel.getLandingInterval())); hiveDestination.setEnabled(hiveDestinationModel.isEnabled()); hiveDestinationAdminClient.updateHiveDestination(name, hiveDestination); } @Autowired  HiveDestinationServiceImpl(HiveDestinationAdminClient hiveDestinationAdminClient); }
HiveDestinationServiceImpl implements HiveDestinationService { @Override public void updateHiveDestination(String name, HiveDestinationModel hiveDestinationModel) throws UnknownRoadException, UnknownDestinationException { HiveDestination hiveDestination = hiveDestinationAdminClient.getHiveDestination(name).orElseThrow( () -> new UnknownDestinationException("Hive", name)); hiveDestination.setLandingInterval(validateAndNormaliseLandingInterval(hiveDestinationModel.getLandingInterval())); hiveDestination.setEnabled(hiveDestinationModel.isEnabled()); hiveDestinationAdminClient.updateHiveDestination(name, hiveDestination); } @Autowired  HiveDestinationServiceImpl(HiveDestinationAdminClient hiveDestinationAdminClient); @Override HiveDestinationModel getHiveDestination(String name); @Override void createHiveDestination(String name, HiveDestinationModel hiveDestinationModel); @Override void updateHiveDestination(String name, HiveDestinationModel hiveDestinationModel); @Override void deleteHiveDestination(String name); }
HiveDestinationServiceImpl implements HiveDestinationService { @Override public void updateHiveDestination(String name, HiveDestinationModel hiveDestinationModel) throws UnknownRoadException, UnknownDestinationException { HiveDestination hiveDestination = hiveDestinationAdminClient.getHiveDestination(name).orElseThrow( () -> new UnknownDestinationException("Hive", name)); hiveDestination.setLandingInterval(validateAndNormaliseLandingInterval(hiveDestinationModel.getLandingInterval())); hiveDestination.setEnabled(hiveDestinationModel.isEnabled()); hiveDestinationAdminClient.updateHiveDestination(name, hiveDestination); } @Autowired  HiveDestinationServiceImpl(HiveDestinationAdminClient hiveDestinationAdminClient); @Override HiveDestinationModel getHiveDestination(String name); @Override void createHiveDestination(String name, HiveDestinationModel hiveDestinationModel); @Override void updateHiveDestination(String name, HiveDestinationModel hiveDestinationModel); @Override void deleteHiveDestination(String name);  }