@Test(expected = IllegalArgumentException.class)
public void testSQSDelayedJob_DelayTooLong() throws Throwable {

  DyneinJobSpec jobSpec =
      DyneinJobSpec.builder()
          .name("AddJob")
          .queueName("error-queue")
          .schedulePolicy(
              JobSchedulePolicy.builder()
                  .type(JobScheduleType.SQS_DELAYED)
                  .epochMillis(Instant.now().plusMillis(1000000L).toEpochMilli())
                  .build())
          .build();
  try {
    scheduler.createJob(jobSpec).join();
  } catch (Exception e) {
    Throwable t = e;
    while (t.getCause() != null) {
      t = t.getCause();
    }
    throw t;
  }
}