@Test public void testValidateScheduleWhenInvalidTimeZone() { TimeAlertRequest request = new TimeAlertRequest(); request.setCron("1 0 1 1 1 1"); request.setTimeZone("GMT-4343"); expectedException.expect(BadRequestException.class); expectedException.expectMessage("Invalid ID for offset-based ZoneId: GMT-4343"); underTest.validateSchedule(request); }
public void validateSchedule(TimeAlertRequest json) { try { dateService.validateTimeZone(json.getTimeZone()); dateService.getCronExpression(json.getCron()); } catch (ParseException parseException) { throw new BadRequestException(parseException.getMessage(), parseException); } }
AlertValidator { public void validateSchedule(TimeAlertRequest json) { try { dateService.validateTimeZone(json.getTimeZone()); dateService.getCronExpression(json.getCron()); } catch (ParseException parseException) { throw new BadRequestException(parseException.getMessage(), parseException); } } }
AlertValidator { public void validateSchedule(TimeAlertRequest json) { try { dateService.validateTimeZone(json.getTimeZone()); dateService.getCronExpression(json.getCron()); } catch (ParseException parseException) { throw new BadRequestException(parseException.getMessage(), parseException); } }  }
AlertValidator { public void validateSchedule(TimeAlertRequest json) { try { dateService.validateTimeZone(json.getTimeZone()); dateService.getCronExpression(json.getCron()); } catch (ParseException parseException) { throw new BadRequestException(parseException.getMessage(), parseException); } }  void validateEntitlementAndDisableIfNotEntitled(Cluster cluster); void validateSupportedHostGroup(Cluster cluster, Set<String> requestHostGroups, AlertType alertType); void validateDistroXAutoscaleClusterRequest(Cluster cluster,
            DistroXAutoscaleClusterRequest distroXAutoscaleClusterRequest); void validateSchedule(TimeAlertRequest json); }
AlertValidator { public void validateSchedule(TimeAlertRequest json) { try { dateService.validateTimeZone(json.getTimeZone()); dateService.getCronExpression(json.getCron()); } catch (ParseException parseException) { throw new BadRequestException(parseException.getMessage(), parseException); } }  void validateEntitlementAndDisableIfNotEntitled(Cluster cluster); void validateSupportedHostGroup(Cluster cluster, Set<String> requestHostGroups, AlertType alertType); void validateDistroXAutoscaleClusterRequest(Cluster cluster,
            DistroXAutoscaleClusterRequest distroXAutoscaleClusterRequest); void validateSchedule(TimeAlertRequest json);  }