Search in sources :

Example 1 with TestApplicationWithoutEngine

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();
}
Also used : TestApplicationWithoutEngine(org.camunda.bpm.application.impl.embedded.TestApplicationWithoutEngine)

Example 2 with TestApplicationWithoutEngine

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));
}
Also used : ProcessApplicationReference(org.camunda.bpm.application.ProcessApplicationReference) BaseDelegateExecution(org.camunda.bpm.engine.delegate.BaseDelegateExecution) TestApplicationWithoutEngine(org.camunda.bpm.application.impl.embedded.TestApplicationWithoutEngine) InvocationContext(org.camunda.bpm.application.InvocationContext) Callable(java.util.concurrent.Callable)

Aggregations

TestApplicationWithoutEngine (org.camunda.bpm.application.impl.embedded.TestApplicationWithoutEngine)2 Callable (java.util.concurrent.Callable)1 InvocationContext (org.camunda.bpm.application.InvocationContext)1 ProcessApplicationReference (org.camunda.bpm.application.ProcessApplicationReference)1 BaseDelegateExecution (org.camunda.bpm.engine.delegate.BaseDelegateExecution)1