@BeforeEach
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
initMocks(this);
this.systemInfo = systemInfo(HOSTNAME, 8080);
this.clock = fixed(now(), systemDefault());
doAnswer(new RunImmediately())
.when(executorService)
.execute(any(Runnable.class));
when(executorService.scheduleAtFixedRate(any(Runnable.class), anyLong(), anyLong(), any(TimeUnit.class)))
.thenReturn(mock(ScheduledFuture.class));
when(jobRunnable.getJobDefinition())
.thenReturn(manuallyTriggerableJobDefinition("someType", "bla", "bla", 0, Optional.empty()));
when(uuidProviderMock.getUuid())
.thenReturn(JOB_ID);
jobService = new JobService(
jobRepository, jobMetaService, singletonList(jobRunnable),
executorService, applicationEventPublisher, clock, systemInfo, uuidProviderMock);
jobService.postConstruct();
}