use of org.camunda.bpm.engine.rest.helper.MockJobBuilder in project camunda-bpm-platform by camunda.
the class JobRestServiceInteractionTest method setUpRuntimeData.
@Before
public void setUpRuntimeData() {
mockQuery = mock(JobQuery.class);
Job mockedJob = new MockJobBuilder().id(MockProvider.EXAMPLE_JOB_ID).processInstanceId(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID).executionId(MockProvider.EXAMPLE_EXECUTION_ID).retries(MockProvider.EXAMPLE_JOB_RETRIES).exceptionMessage(MockProvider.EXAMPLE_JOB_NO_EXCEPTION_MESSAGE).dueDate(new Date()).priority(MockProvider.EXAMPLE_JOB_PRIORITY).jobDefinitionId(MockProvider.EXAMPLE_JOB_DEFINITION_ID).tenantId(MockProvider.EXAMPLE_TENANT_ID).build();
when(mockQuery.singleResult()).thenReturn(mockedJob);
when(mockQuery.jobId(MockProvider.EXAMPLE_JOB_ID)).thenReturn(mockQuery);
mockManagementService = mock(ManagementService.class);
when(mockManagementService.createJobQuery()).thenReturn(mockQuery);
mockSuspensionStateSelectBuilder = mock(UpdateJobSuspensionStateSelectBuilder.class);
when(mockManagementService.updateJobSuspensionState()).thenReturn(mockSuspensionStateSelectBuilder);
mockSuspensionStateBuilder = mock(UpdateJobSuspensionStateTenantBuilder.class);
when(mockSuspensionStateSelectBuilder.byJobId(anyString())).thenReturn(mockSuspensionStateBuilder);
when(mockSuspensionStateSelectBuilder.byJobDefinitionId(anyString())).thenReturn(mockSuspensionStateBuilder);
when(mockSuspensionStateSelectBuilder.byProcessInstanceId(anyString())).thenReturn(mockSuspensionStateBuilder);
when(mockSuspensionStateSelectBuilder.byProcessDefinitionId(anyString())).thenReturn(mockSuspensionStateBuilder);
when(mockSuspensionStateSelectBuilder.byProcessDefinitionKey(anyString())).thenReturn(mockSuspensionStateBuilder);
namedProcessEngine = getProcessEngine(MockProvider.EXAMPLE_PROCESS_ENGINE_NAME);
when(namedProcessEngine.getManagementService()).thenReturn(mockManagementService);
}
Aggregations