@Test public void getHiveDestination() throws Exception { when(hiveDestinationAdminClient.getHiveDestination(NAME)).thenReturn(Optional.of(hiveDestination)); HiveDestinationModel result = underTest.getHiveDestination(NAME); hiveDestinationModel.setLandingInterval("PT1H"); assertThat(result, is(hiveDestinationModel)); }
@Override public HiveDestinationModel getHiveDestination(String name) throws UnknownRoadException, UnknownDestinationException { HiveDestination hiveDestination = hiveDestinationAdminClient.getHiveDestination(name).orElseThrow( () -> new UnknownDestinationException("Hive", name)); HiveDestinationModel hiveDestinationModel = new HiveDestinationModel(); hiveDestinationModel.setEnabled(hiveDestination.isEnabled()); hiveDestinationModel.setLandingInterval(hiveDestination.getLandingInterval()); return hiveDestinationModel; }
HiveDestinationServiceImpl implements HiveDestinationService { @Override public HiveDestinationModel getHiveDestination(String name) throws UnknownRoadException, UnknownDestinationException { HiveDestination hiveDestination = hiveDestinationAdminClient.getHiveDestination(name).orElseThrow( () -> new UnknownDestinationException("Hive", name)); HiveDestinationModel hiveDestinationModel = new HiveDestinationModel(); hiveDestinationModel.setEnabled(hiveDestination.isEnabled()); hiveDestinationModel.setLandingInterval(hiveDestination.getLandingInterval()); return hiveDestinationModel; } }
HiveDestinationServiceImpl implements HiveDestinationService { @Override public HiveDestinationModel getHiveDestination(String name) throws UnknownRoadException, UnknownDestinationException { HiveDestination hiveDestination = hiveDestinationAdminClient.getHiveDestination(name).orElseThrow( () -> new UnknownDestinationException("Hive", name)); HiveDestinationModel hiveDestinationModel = new HiveDestinationModel(); hiveDestinationModel.setEnabled(hiveDestination.isEnabled()); hiveDestinationModel.setLandingInterval(hiveDestination.getLandingInterval()); return hiveDestinationModel; } @Autowired  HiveDestinationServiceImpl(HiveDestinationAdminClient hiveDestinationAdminClient); }
HiveDestinationServiceImpl implements HiveDestinationService { @Override public HiveDestinationModel getHiveDestination(String name) throws UnknownRoadException, UnknownDestinationException { HiveDestination hiveDestination = hiveDestinationAdminClient.getHiveDestination(name).orElseThrow( () -> new UnknownDestinationException("Hive", name)); HiveDestinationModel hiveDestinationModel = new HiveDestinationModel(); hiveDestinationModel.setEnabled(hiveDestination.isEnabled()); hiveDestinationModel.setLandingInterval(hiveDestination.getLandingInterval()); return hiveDestinationModel; } @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 HiveDestinationModel getHiveDestination(String name) throws UnknownRoadException, UnknownDestinationException { HiveDestination hiveDestination = hiveDestinationAdminClient.getHiveDestination(name).orElseThrow( () -> new UnknownDestinationException("Hive", name)); HiveDestinationModel hiveDestinationModel = new HiveDestinationModel(); hiveDestinationModel.setEnabled(hiveDestination.isEnabled()); hiveDestinationModel.setLandingInterval(hiveDestination.getLandingInterval()); return hiveDestinationModel; } @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);  }