VertxJobsService extends RestJobsService { @PostConstruct void initialize() { DatabindCodec.mapper().disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); DatabindCodec.mapper().disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); DatabindCodec.mapper().registerModule(new JavaTimeModule()); DatabindCodec.mapper().findAndRegisterModules(); DatabindCodec.prettyMapper().registerModule(new JavaTimeModule()); DatabindCodec.prettyMapper().findAndRegisterModules(); DatabindCodec.prettyMapper().disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); DatabindCodec.prettyMapper().disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); if (providedWebClient.isResolvable()) { this.client = providedWebClient.get(); LOGGER.debug("Using provided web client instance"); } else { final URI jobServiceURL = getJobsServiceUri(); this.client = WebClient.create(vertx, new WebClientOptions() .setDefaultHost(jobServiceURL.getHost()) .setDefaultPort(jobServiceURL.getPort())); LOGGER.debug("Creating new instance of web client for host {} and port {}", jobServiceURL.getHost(), jobServiceURL.getPort()); } } @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);  }
@Test void testInitialize() { reset(instance); when(instance.isResolvable()).thenReturn(false); tested = new VertxJobsService(JOB_SERVICE_URL, CALLBACK_URL, vertx, instance); tested.initialize(); verify(instance, never()).get(); }