Assert.assertEquals("11", scheduleEntity.getHours());
}
@Test
public void testGetRequestSchedule() throws Exception {
RequestExecution requestExecution = createRequestSchedule();
Assert.assertNotNull(requestExecution);
RequestScheduleEntity scheduleEntity = requestScheduleDAO.findById
(requestExecution.getId());
Assert.assertNotNull(scheduleEntity);
Assert.assertNotNull(cluster.getAllRequestExecutions().get
(requestExecution.getId()));
Assert.assertNotNull(scheduleEntity);
Assert.assertEquals(requestExecution.getBatch().getBatchSettings()
.getTaskFailureToleranceLimit(), scheduleEntity.getBatchTolerationLimit());
Assert.assertEquals(scheduleEntity.getRequestScheduleBatchRequestEntities().size(), 2);
Collection<RequestScheduleBatchRequestEntity> batchRequestEntities =
scheduleEntity.getRequestScheduleBatchRequestEntities();
Assert.assertNotNull(batchRequestEntities);
RequestScheduleBatchRequestEntity reqEntity1 = null;
RequestScheduleBatchRequestEntity reqEntity2 = null;
for (RequestScheduleBatchRequestEntity reqEntity : batchRequestEntities) {
if (reqEntity.getRequestUri().equals("testUri1")) {
reqEntity1 = reqEntity;
} else if (reqEntity.getRequestUri().equals("testUri2")) {
reqEntity2 = reqEntity;
}
}
Assert.assertNotNull(reqEntity1);
Assert.assertNotNull(reqEntity2);
Assert.assertEquals(Long.valueOf(10L), reqEntity1.getBatchId());
Assert.assertEquals(Long.valueOf(12L), reqEntity2.getBatchId());
Assert.assertEquals(BatchRequest.Type.DELETE.name(), reqEntity1.getRequestType());
Assert.assertEquals(BatchRequest.Type.POST.name(), reqEntity2.getRequestType());
Assert.assertEquals(requestExecution.getSchedule().getMinutes(),
scheduleEntity.getMinutes());
Assert.assertEquals(requestExecution.getSchedule().getEndTime(),
scheduleEntity.getEndTime());
}