@Test public void notSpecifiedInterval() throws Exception { assertThat(underTest.validateAndNormaliseLandingInterval(null), is(HiveDestination.DEFAULT_LANDING_INTERVAL)); }
@VisibleForTesting String validateAndNormaliseLandingInterval(String landingInterval) { return Optional .ofNullable(landingInterval) .map(this::parseDuration) .map(this::validateIntervalRange) .map(Duration::toString) .orElse(HiveDestination.DEFAULT_LANDING_INTERVAL); }
HiveDestinationServiceImpl implements HiveDestinationService { @VisibleForTesting String validateAndNormaliseLandingInterval(String landingInterval) { return Optional .ofNullable(landingInterval) .map(this::parseDuration) .map(this::validateIntervalRange) .map(Duration::toString) .orElse(HiveDestination.DEFAULT_LANDING_INTERVAL); } }
HiveDestinationServiceImpl implements HiveDestinationService { @VisibleForTesting String validateAndNormaliseLandingInterval(String landingInterval) { return Optional .ofNullable(landingInterval) .map(this::parseDuration) .map(this::validateIntervalRange) .map(Duration::toString) .orElse(HiveDestination.DEFAULT_LANDING_INTERVAL); } @Autowired  HiveDestinationServiceImpl(HiveDestinationAdminClient hiveDestinationAdminClient); }
HiveDestinationServiceImpl implements HiveDestinationService { @VisibleForTesting String validateAndNormaliseLandingInterval(String landingInterval) { return Optional .ofNullable(landingInterval) .map(this::parseDuration) .map(this::validateIntervalRange) .map(Duration::toString) .orElse(HiveDestination.DEFAULT_LANDING_INTERVAL); } @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 { @VisibleForTesting String validateAndNormaliseLandingInterval(String landingInterval) { return Optional .ofNullable(landingInterval) .map(this::parseDuration) .map(this::validateIntervalRange) .map(Duration::toString) .orElse(HiveDestination.DEFAULT_LANDING_INTERVAL); } @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);  }