use of org.pentaho.platform.api.scheduler2.CronJobTrigger in project pentaho-platform by pentaho.
the class ScheduleExportUtilTest method testCreateJobScheduleRequest_TimeZoneJobParam.
@Test
public void testCreateJobScheduleRequest_TimeZoneJobParam() throws Exception {
String jobName = "JOB";
String timeZone = "America/New_York";
Map<String, Serializable> params = new HashMap<>();
params.put(IBlockoutManager.TIME_ZONE_PARAM, timeZone);
Job job = mock(Job.class);
CronJobTrigger trigger = mock(CronJobTrigger.class);
when(job.getJobTrigger()).thenReturn(trigger);
when(job.getJobName()).thenReturn(jobName);
when(job.getJobParams()).thenReturn(params);
JobScheduleRequest jobScheduleRequest = ScheduleExportUtil.createJobScheduleRequest(job);
assertEquals(timeZone, jobScheduleRequest.getTimeZone());
assertEquals(timeZone, jobScheduleRequest.getJobParameters().get(0).getValue());
}
Aggregations