Package org.camunda.community.mockito
Enum Class CamundaMockito
- All Implemented Interfaces:
Serializable,Comparable<CamundaMockito>,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Method Summary
Modifier and TypeMethodDescriptionstatic voidTakes a BPMN resource and registers mocks for all delegateExpressions.static voidTakes a BPMN file and registers TaskListener-, ExecutionListener and JavaDelegate-Mocks for every delegateExpression encountered.candidateGroupIds(org.camunda.bpm.engine.delegate.DelegateTask task) candidateUserIds(org.camunda.bpm.engine.delegate.DelegateTask task) static DelegateCaseExecutionFakestatic DelegateExecutionFakestatic DelegateTaskFakestatic FluentExecutionListenerMockgetExecutionListenerMock(Class<?> type) static FluentExecutionListenerMockReturns the registered FluentExecutionListenerMock instance for name.static FluentJavaDelegateMockgetJavaDelegateMock(Class<?> type) static FluentJavaDelegateMockgetJavaDelegateMock(String name) Returns the registered FluentJavaDelegateMock instance for name.static <T> TgetRegistered(Class<?> type) static <T> TgetRegistered(String name) static FluentTaskListenerMockgetTaskListenerMock(Class<?> type) static FluentTaskListenerMockgetTaskListenerMock(String name) Returns the registered FluentTaskListenerMock instance for name.static ActivityStatisticsQueryMockmockActivityStatisticsQuery(org.camunda.bpm.engine.ManagementService serviceMock) static AuthorizationQueryMockmockAuthorizationQuery(org.camunda.bpm.engine.AuthorizationService serviceMock) static BatchQueryMockmockBatchQuery(org.camunda.bpm.engine.ManagementService serviceMock) static BatchStatisticsQueryMockmockBatchStatisticsQuery(org.camunda.bpm.engine.ManagementService serviceMock) static CaseDefinitionQueryMockmockCaseDefinitionQuery(org.camunda.bpm.engine.RepositoryService serviceMock) static CaseExecutionQueryMockmockCaseExecutionQuery(org.camunda.bpm.engine.CaseService serviceMock) static CaseInstanceQueryMockmockCaseInstanceQuery(org.camunda.bpm.engine.CaseService serviceMock) static DecisionDefinitionQueryMockmockDecisionDefinitionQuery(org.camunda.bpm.engine.RepositoryService serviceMock) static DeploymentQueryMockmockDeploymentQuery(org.camunda.bpm.engine.RepositoryService serviceMock) mockDeploymentStatisticsQuery(org.camunda.bpm.engine.ManagementService serviceMock) static EventSubscriptionQueryMockmockEventSubscriptionQuery(org.camunda.bpm.engine.RuntimeService serviceMock) static ExecutionQueryMockmockExecutionQuery(org.camunda.bpm.engine.RuntimeService serviceMock) static ExternalTaskQueryMockmockExternalTaskQuery(org.camunda.bpm.engine.ExternalTaskService serviceMock) static FilterQueryMockmockFilterQuery(org.camunda.bpm.engine.FilterService serviceMock) static GroupQueryMockmockGroupQuery(org.camunda.bpm.engine.IdentityService serviceMock) mockHistoricActivityStatisticsQuery(org.camunda.bpm.engine.HistoryService serviceMock) static HistoricBatchQueryMockmockHistoricBatchQuery(org.camunda.bpm.engine.HistoryService serviceMock) mockHistoricCaseActivityInstanceQuery(org.camunda.bpm.engine.HistoryService serviceMock) mockHistoricCaseInstanceQuery(org.camunda.bpm.engine.HistoryService serviceMock) mockHistoricDecisionInstanceQuery(org.camunda.bpm.engine.HistoryService serviceMock) static HistoricDetailQueryMockmockHistoricDetailQuery(org.camunda.bpm.engine.HistoryService serviceMock) mockHistoricIdentityLinkLogQuery(org.camunda.bpm.engine.HistoryService serviceMock) static HistoricIncidentQueryMockmockHistoricIncidentQuery(org.camunda.bpm.engine.HistoryService serviceMock) static HistoricJobLogQueryMockmockHistoricJobLogQuery(org.camunda.bpm.engine.HistoryService serviceMock) mockHistoricProcessInstanceQuery(org.camunda.bpm.engine.HistoryService serviceMock) mockHistoricTaskInstanceQuery(org.camunda.bpm.engine.HistoryService serviceMock) mockHistoricVariableInstanceQuery(org.camunda.bpm.engine.HistoryService serviceMock) static IncidentQueryMockmockIncidentQuery(org.camunda.bpm.engine.RuntimeService serviceMock) static JobDefinitionQueryMockmockJobDefinitionQuery(org.camunda.bpm.engine.ManagementService serviceMock) static JobQueryMockmockJobQuery(org.camunda.bpm.engine.ManagementService serviceMock) static ProcessDefinitionQueryMockmockProcessDefinitionQuery(org.camunda.bpm.engine.RepositoryService serviceMock) mockProcessDefinitionStatisticsQuery(org.camunda.bpm.engine.ManagementService serviceMock) static ProcessInstanceQueryMockmockProcessInstanceQuery(org.camunda.bpm.engine.RuntimeService serviceMock) static TaskQueryMockmockTaskQuery(org.camunda.bpm.engine.TaskService serviceMock) static TenantQueryMockmockTenantQuery(org.camunda.bpm.engine.IdentityService serviceMock) static UserOperationLogQueryMockmockUserOperationLogQuery(org.camunda.bpm.engine.HistoryService serviceMock) static UserQueryMockmockUserQuery(org.camunda.bpm.engine.IdentityService serviceMock) static VariableInstanceQueryMockmockVariableInstanceQuery(org.camunda.bpm.engine.RuntimeService serviceMock) static CallActivityMockregisterCallActivityMock(String processDefinitionKey) static FluentExecutionListenerMockregisterExecutionListenerMock(Class<? extends org.camunda.bpm.engine.delegate.ExecutionListener> type) Registers a new FluentExecutionListenerMock instance for name (by type).static FluentExecutionListenerMockRegisters a new FluentExecutionListenerMock instance for name.static <T> TregisterInstance(String name, T instance) Delegates toMocks.register(String, Object)static <T> TregisterInstance(T instance) If you already have the instance, register it directly.static voidregisterInstancesForFields(Object instance) Registers mocks viaMocks.register(String, Object)for all attributes with Named-types.static FluentJavaDelegateMockregisterJavaDelegateMock(Class<? extends org.camunda.bpm.engine.delegate.JavaDelegate> type) Registers a new FluentJavaDelegateMock instance for name (by type).static FluentJavaDelegateMockRegisters a new FluentJavaDelegateMock instance for name.static <T> TregisterMockInstance(Class<T> type) Creates a mock for the given type and registers it.static <T> TregisterMockInstance(String name, Class<T> type) Creates a mock for the given type and registers it.static voidregisterMockInstances(Class<?>... types) Creates and registers mock instance for every given type.static voidregisterMockInstances(Collection<Class<?>> types) Creates and registers mock instance for every given type.static voidregisterMockInstancesForNestedTypes(Class<?> parentClass) Registers mock instances for every public static nested class found in parentClass.static <T> TregisterNewInstance(Class<T> type) Creates a new instance for the given type using the default constructor and registers it.static <T> TregisterNewInstance(String name, Class<T> type) Creates a new instance for the given type and registers it under the given name.static voidregisterNewInstancesForNestedTypes(Class<?> parentClass) Registers new instances for every public static nested class found in parentClass.static FluentTaskListenerMockregisterTaskListenerMock(Class<? extends org.camunda.bpm.engine.delegate.TaskListener> type) Registers a new FluentTaskListenerMock instance for name (by type).static FluentTaskListenerMockRegisters a new FluentTaskListenerMock instance for name.static voidreset()static RuntimeServiceFluentMockstatic RuntimeServiceFluentMockruntimeServiceFluentMock(org.camunda.bpm.engine.RuntimeService runtimeServiceMock) static CamundaMockitoReturns the enum constant of this class with the specified name.static CamundaMockito[]values()Returns an array containing the constants of this enum class, in the order they are declared.static VariableScopeFakestatic MockitoVerification<org.camunda.bpm.engine.delegate.DelegateExecution>verifyExecutionListenerMock(Class<?> type) Gets the registered FluentExecutionListenerMock and creates a verification instance.static MockitoVerification<org.camunda.bpm.engine.delegate.DelegateExecution>Gets the registered FluentExecutionListenerMock and creates a verification instance.static MockitoVerification<org.camunda.bpm.engine.delegate.DelegateExecution>verifyExecutionListenerMock(FluentExecutionListenerMock fluentExecutionListenerMock) Creates a verification instance for ExecutionListener.static MockitoVerification<org.camunda.bpm.engine.delegate.DelegateExecution>verifyJavaDelegateMock(Class<?> type) Gets the registered FluentJavaDelegateMock and creates a verification instance.static MockitoVerification<org.camunda.bpm.engine.delegate.DelegateExecution>verifyJavaDelegateMock(String name) Gets the registered FluentJavaDelegateMock and creates a verification instance.static MockitoVerification<org.camunda.bpm.engine.delegate.DelegateExecution>verifyJavaDelegateMock(FluentJavaDelegateMock fluentJavaDelegateMock) Creates a verification instance for JavaDelegate.static MockitoVerification<org.camunda.bpm.engine.delegate.DelegateTask>verifyTaskListenerMock(Class<?> type) Gets the registered FluentExecutionListenerMock and creates a verification instance.static MockitoVerification<org.camunda.bpm.engine.delegate.DelegateTask>verifyTaskListenerMock(String name) Gets the registered FluentTaskListenerMock and creates a verification instance.static MockitoVerification<org.camunda.bpm.engine.delegate.DelegateTask>verifyTaskListenerMock(FluentTaskListenerMock fluentTaskListenerMock) Creates a verification instance for TaskListener.
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
autoMock
Takes a BPMN resource and registers mocks for all delegateExpressions.- Parameters:
bpmnFileResource- the bpm file resource to parse- See Also:
-
autoMock
Takes a BPMN file and registers TaskListener-, ExecutionListener and JavaDelegate-Mocks for every delegateExpression encountered.This is an auto-mock feature that allows the process to run. If you need to modify the behavior of the mock, you can use the getXXX() methods to access it by its name.
- Parameters:
bpmnFile- the BPMN resource to parse
-
registerJavaDelegateMock
Registers a new FluentJavaDelegateMock instance for name.- Parameters:
name- the name under which the instance is registered- Returns:
- new fluent-mock instance
- See Also:
-
registerJavaDelegateMock
public static FluentJavaDelegateMock registerJavaDelegateMock(Class<? extends org.camunda.bpm.engine.delegate.JavaDelegate> type) Registers a new FluentJavaDelegateMock instance for name (by type).- Parameters:
type- the type to register- Returns:
- new fluent-mock instance
-
registerExecutionListenerMock
Registers a new FluentExecutionListenerMock instance for name.- Parameters:
name- the name under which the instance is registered- Returns:
- new fluent-mock instance
- See Also:
-
registerExecutionListenerMock
public static FluentExecutionListenerMock registerExecutionListenerMock(Class<? extends org.camunda.bpm.engine.delegate.ExecutionListener> type) Registers a new FluentExecutionListenerMock instance for name (by type).- Parameters:
type- the type to register- Returns:
- new fluent-mock instance
-
registerTaskListenerMock
Registers a new FluentTaskListenerMock instance for name.- Parameters:
name- the name under which the instance is registered- Returns:
- new fluent-mock instance
- See Also:
-
registerTaskListenerMock
public static FluentTaskListenerMock registerTaskListenerMock(Class<? extends org.camunda.bpm.engine.delegate.TaskListener> type) Registers a new FluentTaskListenerMock instance for name (by type).- Parameters:
type- the type to register- Returns:
- new fluent-mock instance
-
getJavaDelegateMock
Returns the registered FluentJavaDelegateMock instance for name.- Parameters:
name- the name under which the instance is registered- Returns:
- the registered fluent-mock instance
- See Also:
-
getJavaDelegateMock
-
getExecutionListenerMock
Returns the registered FluentExecutionListenerMock instance for name.- Parameters:
name- the name under which the instance is registered- Returns:
- the registered fluent-mock instance
- See Also:
-
getExecutionListenerMock
-
getTaskListenerMock
Returns the registered FluentTaskListenerMock instance for name.- Parameters:
name- the name under which the instance is registered- Returns:
- the registered fluent-mock instance
- See Also:
-
getTaskListenerMock
-
verifyJavaDelegateMock
public static MockitoVerification<org.camunda.bpm.engine.delegate.DelegateExecution> verifyJavaDelegateMock(String name) Gets the registered FluentJavaDelegateMock and creates a verification instance.- Parameters:
name- the name under which the instance is registered- Returns:
- verification for JavaDelegate
- See Also:
-
verifyJavaDelegateMock
public static MockitoVerification<org.camunda.bpm.engine.delegate.DelegateExecution> verifyJavaDelegateMock(Class<?> type) Gets the registered FluentJavaDelegateMock and creates a verification instance.- Parameters:
type- the type of the delegate to lookup- Returns:
- verifcation for JavaDelegate
-
verifyJavaDelegateMock
public static MockitoVerification<org.camunda.bpm.engine.delegate.DelegateExecution> verifyJavaDelegateMock(FluentJavaDelegateMock fluentJavaDelegateMock) Creates a verification instance for JavaDelegate.- Parameters:
fluentJavaDelegateMock- the fluent-mock instance- Returns:
- verification for JavaDelegate
-
verifyExecutionListenerMock
public static MockitoVerification<org.camunda.bpm.engine.delegate.DelegateExecution> verifyExecutionListenerMock(String name) Gets the registered FluentExecutionListenerMock and creates a verification instance.- Parameters:
name- the name under which the instance is registered- Returns:
- verification for ExecutionListener
- See Also:
-
verifyExecutionListenerMock
public static MockitoVerification<org.camunda.bpm.engine.delegate.DelegateExecution> verifyExecutionListenerMock(Class<?> type) Gets the registered FluentExecutionListenerMock and creates a verification instance.- Parameters:
type- the type of the listener to lookup- Returns:
- verification for ExecutionListener
-
verifyExecutionListenerMock
public static MockitoVerification<org.camunda.bpm.engine.delegate.DelegateExecution> verifyExecutionListenerMock(FluentExecutionListenerMock fluentExecutionListenerMock) Creates a verification instance for ExecutionListener.- Parameters:
fluentExecutionListenerMock- the fluent-mock instance- Returns:
- verification for JavaDelegate
-
verifyTaskListenerMock
public static MockitoVerification<org.camunda.bpm.engine.delegate.DelegateTask> verifyTaskListenerMock(String name) Gets the registered FluentTaskListenerMock and creates a verification instance.- Parameters:
name- the name under which the instance is registered- Returns:
- verification for TaskListener
- See Also:
-
verifyTaskListenerMock
public static MockitoVerification<org.camunda.bpm.engine.delegate.DelegateTask> verifyTaskListenerMock(Class<?> type) Gets the registered FluentExecutionListenerMock and creates a verification instance.- Parameters:
type- the type of the listener to lookup- Returns:
- verification for TaskListener
-
verifyTaskListenerMock
public static MockitoVerification<org.camunda.bpm.engine.delegate.DelegateTask> verifyTaskListenerMock(FluentTaskListenerMock fluentTaskListenerMock) Creates a verification instance for TaskListener.- Parameters:
fluentTaskListenerMock- the fluent-mock instance- Returns:
- verification for TaskListener
-
registerMockInstancesForNestedTypes
Registers mock instances for every public static nested class found in parentClass.- Parameters:
parentClass- the parentClass to scan for nested public static types
-
registerInstancesForFields
Registers mocks viaMocks.register(String, Object)for all attributes with Named-types.- Parameters:
instance- instance who's fields are registered (maybe Junit test or jbehave steps).
-
registerNewInstancesForNestedTypes
Registers new instances for every public static nested class found in parentClass.- Parameters:
parentClass- the parentClass to scan for nested public static types
-
registerMockInstances
Creates and registers mock instance for every given type.- Parameters:
types- collection of types to mock and register- See Also:
-
registerMockInstances
Creates and registers mock instance for every given type.- Parameters:
types- collection of types to mock and register
-
registerMockInstance
Creates a mock for the given type and registers it.- Parameters:
name- the juel name under which the mock is registeredtype- the type of the mock to create- Returns:
- the registered mock instance
-
registerMockInstance
Creates a mock for the given type and registers it.- Parameters:
type- the type of the mock to create- Returns:
- the registered mock instance
-
registerNewInstance
Creates a new instance for the given type and registers it under the given name.- Parameters:
name- the name for the registered instancetype- the type of the instance to create- Returns:
- the registered instance
-
registerNewInstance
Creates a new instance for the given type using the default constructor and registers it.- Parameters:
type- the type of the instance to create- Returns:
- the registered instance
- See Also:
-
registerInstance
public static <T> T registerInstance(T instance) If you already have the instance, register it directly. Name is guessed viaNameForType.- Parameters:
instance- the instance or mock to register- Returns:
- the registered instance
-
registerInstance
Delegates toMocks.register(String, Object)- Parameters:
name- the juel name for the registered instanceinstance- the instance to register- Returns:
- the registered instance
-
getRegistered
- Parameters:
name- juel name of the registered instance or mock- Returns:
- registered instance or mock of type
-
getRegistered
- Parameters:
type- the type of the registered instance or mock- Returns:
- registered instance or mock for type
-
reset
public static void reset()- See Also:
-
Mocks.reset()
-
mockFilterQuery
-
mockTaskQuery
-
mockCaseInstanceQuery
public static CaseInstanceQueryMock mockCaseInstanceQuery(org.camunda.bpm.engine.CaseService serviceMock) -
mockCaseExecutionQuery
public static CaseExecutionQueryMock mockCaseExecutionQuery(org.camunda.bpm.engine.CaseService serviceMock) -
mockExecutionQuery
public static ExecutionQueryMock mockExecutionQuery(org.camunda.bpm.engine.RuntimeService serviceMock) -
mockProcessInstanceQuery
public static ProcessInstanceQueryMock mockProcessInstanceQuery(org.camunda.bpm.engine.RuntimeService serviceMock) -
mockIncidentQuery
public static IncidentQueryMock mockIncidentQuery(org.camunda.bpm.engine.RuntimeService serviceMock) -
mockEventSubscriptionQuery
public static EventSubscriptionQueryMock mockEventSubscriptionQuery(org.camunda.bpm.engine.RuntimeService serviceMock) -
mockVariableInstanceQuery
public static VariableInstanceQueryMock mockVariableInstanceQuery(org.camunda.bpm.engine.RuntimeService serviceMock) -
mockProcessDefinitionQuery
public static ProcessDefinitionQueryMock mockProcessDefinitionQuery(org.camunda.bpm.engine.RepositoryService serviceMock) -
mockCaseDefinitionQuery
public static CaseDefinitionQueryMock mockCaseDefinitionQuery(org.camunda.bpm.engine.RepositoryService serviceMock) -
mockDecisionDefinitionQuery
public static DecisionDefinitionQueryMock mockDecisionDefinitionQuery(org.camunda.bpm.engine.RepositoryService serviceMock) -
mockDeploymentQuery
public static DeploymentQueryMock mockDeploymentQuery(org.camunda.bpm.engine.RepositoryService serviceMock) -
mockHistoricIdentityLinkLogQuery
public static HistoricIdentityLinkLogQueryMock mockHistoricIdentityLinkLogQuery(org.camunda.bpm.engine.HistoryService serviceMock) -
mockHistoricProcessInstanceQuery
public static HistoricProcessInstanceQueryMock mockHistoricProcessInstanceQuery(org.camunda.bpm.engine.HistoryService serviceMock) -
mockHistoricActivityStatisticsQuery
public static HistoricActivityStatisticsQueryMock mockHistoricActivityStatisticsQuery(org.camunda.bpm.engine.HistoryService serviceMock) -
mockHistoricVariableInstanceQuery
public static HistoricVariableInstanceQueryMock mockHistoricVariableInstanceQuery(org.camunda.bpm.engine.HistoryService serviceMock) -
mockHistoricCaseActivityInstanceQuery
public static HistoricCaseActivityInstanceQueryMock mockHistoricCaseActivityInstanceQuery(org.camunda.bpm.engine.HistoryService serviceMock) -
mockHistoricDecisionInstanceQuery
public static HistoricDecisionInstanceQueryMock mockHistoricDecisionInstanceQuery(org.camunda.bpm.engine.HistoryService serviceMock) -
mockHistoricTaskInstanceQuery
public static HistoricTaskInstanceQueryMock mockHistoricTaskInstanceQuery(org.camunda.bpm.engine.HistoryService serviceMock) -
mockHistoricDetailQuery
public static HistoricDetailQueryMock mockHistoricDetailQuery(org.camunda.bpm.engine.HistoryService serviceMock) -
mockUserOperationLogQuery
public static UserOperationLogQueryMock mockUserOperationLogQuery(org.camunda.bpm.engine.HistoryService serviceMock) -
mockHistoricIncidentQuery
public static HistoricIncidentQueryMock mockHistoricIncidentQuery(org.camunda.bpm.engine.HistoryService serviceMock) -
mockHistoricCaseInstanceQuery
public static HistoricCaseInstanceQueryMock mockHistoricCaseInstanceQuery(org.camunda.bpm.engine.HistoryService serviceMock) -
mockHistoricJobLogQuery
public static HistoricJobLogQueryMock mockHistoricJobLogQuery(org.camunda.bpm.engine.HistoryService serviceMock) -
mockHistoricBatchQuery
public static HistoricBatchQueryMock mockHistoricBatchQuery(org.camunda.bpm.engine.HistoryService serviceMock) -
mockUserQuery
-
mockGroupQuery
-
mockTenantQuery
-
mockJobQuery
-
mockBatchQuery
-
mockProcessDefinitionStatisticsQuery
public static ProcessDefinitionStatisticsQueryMock mockProcessDefinitionStatisticsQuery(org.camunda.bpm.engine.ManagementService serviceMock) -
mockJobDefinitionQuery
public static JobDefinitionQueryMock mockJobDefinitionQuery(org.camunda.bpm.engine.ManagementService serviceMock) -
mockDeploymentStatisticsQuery
public static DeploymentStatisticsQueryMock mockDeploymentStatisticsQuery(org.camunda.bpm.engine.ManagementService serviceMock) -
mockActivityStatisticsQuery
public static ActivityStatisticsQueryMock mockActivityStatisticsQuery(org.camunda.bpm.engine.ManagementService serviceMock) -
mockBatchStatisticsQuery
public static BatchStatisticsQueryMock mockBatchStatisticsQuery(org.camunda.bpm.engine.ManagementService serviceMock) -
mockAuthorizationQuery
public static AuthorizationQueryMock mockAuthorizationQuery(org.camunda.bpm.engine.AuthorizationService serviceMock) -
mockExternalTaskQuery
public static ExternalTaskQueryMock mockExternalTaskQuery(org.camunda.bpm.engine.ExternalTaskService serviceMock) -
variableScopeFake
-
delegateExecutionFake
-
delegateCaseExecutionFake
-
delegateCaseVariableInstanceFake
-
delegateTaskFake
-
candidateUserIds
-
candidateGroupIds
-
registerCallActivityMock
-
runtimeServiceFluentMock
-
runtimeServiceFluentMock
public static RuntimeServiceFluentMock runtimeServiceFluentMock(org.camunda.bpm.engine.RuntimeService runtimeServiceMock)
-