Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds create, update, delete of a schedule and a job scheduling at once #81

Merged
merged 10 commits into from
Feb 8, 2019
Prev Previous commit
Next Next commit
Add test for non existing job schedule deletion.
  • Loading branch information
refond committed Dec 17, 2018
commit cc8f7f845fb6b6d33affb463035d205f682e0ae3
22 changes: 21 additions & 1 deletion src/test/scala/QuartzSchedulerFunctionalSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class QuartzSchedulerFunctionalSpec(_system: ActorSystem) extends TestKit(_syste
}


"Delete an existing job schedule Cron Job should throw no error and let creation of new schedule with identical job name" in {
"Delete an existing job schedule Cron Job without any error and allow successful creation of new schedule with identical job name" in {

val toDeleteSheduleJobName = "toBeDeletedscheduleCron_1"

Expand All @@ -306,7 +306,27 @@ class QuartzSchedulerFunctionalSpec(_system: ActorSystem) extends TestKit(_syste
fail(s"deleteJobSchedule(${toDeleteSheduleJobName}) expected to return true returned false.")
}
}
}

"Delete a non existing job schedule Cron Job with no error and a return value false" in {

val nonExistingCronToBeDeleted = "nonExistingCronToBeDeleted"

val receiver = _system.actorOf(Props(new ScheduleTestReceiver))
val probe = TestProbe()
receiver ! NewProbe(probe.ref)

noException should be thrownBy {
// Deleting non existing scheduled job
val success = QuartzSchedulerExtension(_system).deleteJobSchedule(nonExistingCronToBeDeleted)
// must return false
if (success) {
fail(s"deleteJobSchedule(${nonExistingCronToBeDeleted}) expected to return false returned true.")
}
}
}



}

Expand Down