See gh-44148

Signed-off-by: Johnny Lim <izeye@naver.com>
This commit is contained in:
Johnny Lim
2025-02-07 00:15:25 +09:00
committed by Moritz Halbritter
parent 1e73a7cf8b
commit c335f772d0
11 changed files with 28 additions and 17 deletions

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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());