Class FluentMock<T,P extends org.camunda.bpm.engine.delegate.VariableScope>
- java.lang.Object
-
- org.camunda.bpm.extension.mockito.mock.FluentMock<T,P>
-
- Type Parameters:
T- type of mock (JavaDelegate, ExecutionListener, TaskListener)P- type of method argument (DelegateExecution, DelegateTask)
- Direct Known Subclasses:
FluentExecutionListenerMock,FluentJavaDelegateMock,FluentTaskListenerMock
public abstract class FluentMock<T,P extends org.camunda.bpm.engine.delegate.VariableScope> extends Object
Common super class for all fluent mocks.
-
-
Field Summary
Fields Modifier and Type Field Description protected Tmockprotected Class<P>parameterType
-
Constructor Summary
Constructors Modifier Constructor Description protectedFluentMock(T mock, Class<P> parameterType)Creates a new instance for given mock.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Pany()TgetMock()<V> voidonExecutionSetVariable(io.holunda.camunda.bpm.data.factory.VariableFactory<V> variable, V value)voidonExecutionSetVariable(String key, Object value)voidonExecutionSetVariables(Map<String,Object> variables)abstract voidonExecutionSetVariables(org.camunda.bpm.engine.variable.VariableMap variableMap)voidonExecutionThrowBpmnError(String errorCode)The mock will throw a BpmnError with given errorCode.voidonExecutionThrowBpmnError(String errorCode, String message)The mock will throw a BpmnError with given errorCode and message.abstract voidonExecutionThrowBpmnError(org.camunda.bpm.engine.delegate.BpmnError bpmnError)The implementation of throw-bpmn-error depends on the concrete type.abstract voidonExecutionThrowException(Exception exception)The mock will throw the given exception on execution.protected voidsetVariables(org.camunda.bpm.engine.delegate.VariableScope variableScope, Map<String,Object> variables)
-
-
-
Method Detail
-
setVariables
protected void setVariables(org.camunda.bpm.engine.delegate.VariableScope variableScope, Map<String,Object> variables)
-
onExecutionSetVariables
public abstract void onExecutionSetVariables(org.camunda.bpm.engine.variable.VariableMap variableMap)
- Parameters:
variableMap- the process variables this delegate sets when executed
-
onExecutionSetVariable
public void onExecutionSetVariable(String key, Object value)
- Parameters:
key- of the process variables this delegate sets when executedvalue- of the process variables this delegate sets when executed
-
onExecutionSetVariable
public <V> void onExecutionSetVariable(io.holunda.camunda.bpm.data.factory.VariableFactory<V> variable, V value)- Type Parameters:
V- the payload type of the variable- Parameters:
variable- the VariableFactory declartion (name and type of variable)value- the value to set. Type safe.- See Also:
onExecutionSetVariable(String, Object)
-
onExecutionSetVariables
public void onExecutionSetVariables(Map<String,Object> variables)
- Parameters:
variables- the process variables this delegate sets when executed
-
onExecutionThrowBpmnError
public void onExecutionThrowBpmnError(String errorCode)
The mock will throw a BpmnError with given errorCode.- Parameters:
errorCode- the error code
-
onExecutionThrowBpmnError
public void onExecutionThrowBpmnError(String errorCode, String message)
The mock will throw a BpmnError with given errorCode and message.- Parameters:
errorCode- the error codemessage- the error message
-
onExecutionThrowBpmnError
public abstract void onExecutionThrowBpmnError(org.camunda.bpm.engine.delegate.BpmnError bpmnError)
The implementation of throw-bpmn-error depends on the concrete type.- Parameters:
bpmnError- the error instance
-
onExecutionThrowException
public abstract void onExecutionThrowException(Exception exception)
The mock will throw the given exception on execution.- Parameters:
exception- the exception instance
-
getMock
public T getMock()
- Returns:
- the internal mock
-
any
protected P any()
- Returns:
- any(P) for use in Mockito when/doAnswer
-
-