@Test
void testScheduleProcessInstanceJob() {

    when(restTemplate.postForEntity(any(URI.class), any(Job.class), eq(String.class))).thenReturn(ResponseEntity.ok().build());
    ProcessInstanceJobDescription processInstanceJobDescription = ProcessInstanceJobDescription.of(123,
                                                                                                   ExactExpirationTime.now(),
                                                                                                   "processInstanceId",
                                                                                                   "processId");
    tested.scheduleProcessInstanceJob(processInstanceJobDescription);
    ArgumentCaptor<Job> jobArgumentCaptor = forClass(Job.class);
    verify(restTemplate).postForEntity(eq(tested.getJobsServiceUri()),
                                       jobArgumentCaptor.capture(),
                                       eq(String.class));
    Job job = jobArgumentCaptor.getValue();
    assertThat(job.getId()).isEqualTo(processInstanceJobDescription.id());
}