use of org.camunda.bpm.application.impl.embedded.TestApplicationWithoutEngine in project camunda-bpm-platform by camunda.
the class ProcessApplicationContextTest method setUp.
@Override
public void setUp() {
pa = new TestApplicationWithoutEngine();
pa.deploy();
}
use of org.camunda.bpm.application.impl.embedded.TestApplicationWithoutEngine in project camunda-bpm-platform by camunda.
the class ProcessApplicationContextTest method testExecuteWithInvocationContext.
@SuppressWarnings("unchecked")
public void testExecuteWithInvocationContext() throws Exception {
// given a process application which extends the default one
// - using a spy for verify the invocations
TestApplicationWithoutEngine processApplication = spy(pa);
ProcessApplicationReference processApplicationReference = mock(ProcessApplicationReference.class);
when(processApplicationReference.getProcessApplication()).thenReturn(processApplication);
// when execute with context
InvocationContext invocationContext = new InvocationContext(mock(BaseDelegateExecution.class));
Context.executeWithinProcessApplication(mock(Callable.class), processApplicationReference, invocationContext);
// then the execute method should be invoked with context
verify(processApplication).execute(any(Callable.class), eq(invocationContext));
// and forward to call to the default execute method
verify(processApplication).execute(any(Callable.class));
}
Aggregations