@Test void testCancelJob(@Mock HttpRequest<Buffer> request) { when(webClient.delete(anyString())).thenReturn(request); tested.cancelJob("123"); verify(webClient).delete("/jobs/123"); }
@Override public boolean cancelJob(String id) { client.delete(JOBS_PATH + "/" + id).send(res -> { if (res.succeeded() && (res.result().statusCode() == 200 || res.result().statusCode() == 404)) { LOGGER.debug("Canceling of the job {} done with status code {} ", id, res.result().statusCode()); } else { LOGGER.error("Canceling of job {} failed with response code {}", id, res.result().statusCode(), res.cause()); } }); return true; }
VertxJobsService extends RestJobsService { @Override public boolean cancelJob(String id) { client.delete(JOBS_PATH + "/" + id).send(res -> { if (res.succeeded() && (res.result().statusCode() == 200 || res.result().statusCode() == 404)) { LOGGER.debug("Canceling of the job {} done with status code {} ", id, res.result().statusCode()); } else { LOGGER.error("Canceling of job {} failed with response code {}", id, res.result().statusCode(), res.cause()); } }); return true; } }
VertxJobsService extends RestJobsService { @Override public boolean cancelJob(String id) { client.delete(JOBS_PATH + "/" + id).send(res -> { if (res.succeeded() && (res.result().statusCode() == 200 || res.result().statusCode() == 404)) { LOGGER.debug("Canceling of the job {} done with status code {} ", id, res.result().statusCode()); } else { LOGGER.error("Canceling of job {} failed with response code {}", id, res.result().statusCode(), res.cause()); } }); return true; } @Inject  VertxJobsService(@ConfigProperty(name = "kogito.jobs-service.url") String jobServiceUrl,
                            @ConfigProperty(name = "kogito.service.url") String callbackEndpoint,
                            Vertx vertx,
                            Instance<WebClient> providedWebClient);   VertxJobsService(); }
VertxJobsService extends RestJobsService { @Override public boolean cancelJob(String id) { client.delete(JOBS_PATH + "/" + id).send(res -> { if (res.succeeded() && (res.result().statusCode() == 200 || res.result().statusCode() == 404)) { LOGGER.debug("Canceling of the job {} done with status code {} ", id, res.result().statusCode()); } else { LOGGER.error("Canceling of job {} failed with response code {}", id, res.result().statusCode(), res.cause()); } }); return true; } @Inject  VertxJobsService(@ConfigProperty(name = "kogito.jobs-service.url") String jobServiceUrl,
                            @ConfigProperty(name = "kogito.service.url") String callbackEndpoint,
                            Vertx vertx,
                            Instance<WebClient> providedWebClient);   VertxJobsService(); @Override String scheduleProcessJob(ProcessJobDescription description); @Override String scheduleProcessInstanceJob(ProcessInstanceJobDescription description); @Override boolean cancelJob(String id); @Override ZonedDateTime getScheduledTime(String id); }
VertxJobsService extends RestJobsService { @Override public boolean cancelJob(String id) { client.delete(JOBS_PATH + "/" + id).send(res -> { if (res.succeeded() && (res.result().statusCode() == 200 || res.result().statusCode() == 404)) { LOGGER.debug("Canceling of the job {} done with status code {} ", id, res.result().statusCode()); } else { LOGGER.error("Canceling of job {} failed with response code {}", id, res.result().statusCode(), res.cause()); } }); return true; } @Inject  VertxJobsService(@ConfigProperty(name = "kogito.jobs-service.url") String jobServiceUrl,
                            @ConfigProperty(name = "kogito.service.url") String callbackEndpoint,
                            Vertx vertx,
                            Instance<WebClient> providedWebClient);   VertxJobsService(); @Override String scheduleProcessJob(ProcessJobDescription description); @Override String scheduleProcessInstanceJob(ProcessInstanceJobDescription description); @Override boolean cancelJob(String id); @Override ZonedDateTime getScheduledTime(String id);  }