committed by
Moritz Halbritter
parent
1e73a7cf8b
commit
c335f772d0
@@ -409,7 +409,9 @@ public class QuartzEndpoint {
|
||||
}
|
||||
|
||||
/**
|
||||
* Description of a triggered on demand {@link Job Quartz Job}.
|
||||
* Description of a triggered on-demand {@link Job Quartz Job}.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*/
|
||||
public static final class QuartzJobTriggerDescriptor {
|
||||
|
||||
|
||||
@@ -80,6 +80,16 @@ public class QuartzEndpointWebExtension {
|
||||
() -> this.delegate.quartzTrigger(group, name, showUnsanitized));
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger a Quartz job.
|
||||
* @param jobs path segment "jobs"
|
||||
* @param group job's group
|
||||
* @param name job name
|
||||
* @param state desired state
|
||||
* @return web endpoint response
|
||||
* @throws SchedulerException if there is an error triggering the job
|
||||
* @since 3.5.0
|
||||
*/
|
||||
@WriteOperation
|
||||
public WebEndpointResponse<Object> triggerQuartzJob(@Selector String jobs, @Selector String group,
|
||||
@Selector String name, String state) throws SchedulerException {
|
||||
|
||||
@@ -778,7 +778,7 @@ class QuartzEndpointTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void quartzJobShouldNotBeTriggeredJobDoesNotExist() throws SchedulerException {
|
||||
void quartzJobShouldNotBeTriggeredWhenJobDoesNotExist() throws SchedulerException {
|
||||
QuartzJobTriggerDescriptor quartzJobTriggerDescriptor = this.endpoint.triggerQuartzJob("samples", "hello");
|
||||
assertThat(quartzJobTriggerDescriptor).isNull();
|
||||
then(this.scheduler).should(never()).triggerJob(any());
|
||||
|
||||
Reference in New Issue
Block a user