use of org.camunda.bpm.engine.test.api.delegate.AssertingJavaDelegate.DelegateExecutionAsserter in project camunda-bpm-platform by camunda.
the class DelegateExecutionHierarchyTest method testTaskInsideEmbeddedSubprocess.
public void testTaskInsideEmbeddedSubprocess() {
deployment(Bpmn.createExecutableProcess("testProcess").startEvent().subProcess().embeddedSubProcess().startEvent().serviceTask().camundaClass(AssertingJavaDelegate.class.getName()).endEvent().subProcessDone().endEvent().done());
AssertingJavaDelegate.addAsserts(new DelegateExecutionAsserter() {
public void doAssert(DelegateExecution execution) {
assertFalse(execution.equals(execution.getProcessInstance()));
assertNull(execution.getSuperExecution());
}
});
runtimeService.startProcessInstanceByKey("testProcess");
}
use of org.camunda.bpm.engine.test.api.delegate.AssertingJavaDelegate.DelegateExecutionAsserter in project camunda-bpm-platform by camunda.
the class MultiTenancyJobExecutorTest method hasAuthenticatedTenantId.
protected static DelegateExecutionAsserter hasAuthenticatedTenantId(final String expectedTenantId) {
return new DelegateExecutionAsserter() {
@Override
public void doAssert(DelegateExecution execution) {
IdentityService identityService = execution.getProcessEngineServices().getIdentityService();
Authentication currentAuthentication = identityService.getCurrentAuthentication();
assertThat(currentAuthentication, is(notNullValue()));
assertThat(currentAuthentication.getTenantIds(), hasItem(expectedTenantId));
}
};
}
use of org.camunda.bpm.engine.test.api.delegate.AssertingJavaDelegate.DelegateExecutionAsserter in project camunda-bpm-platform by camunda.
the class MultiTenancyJobExecutorTest method hasNoAuthenticatedTenantId.
protected static DelegateExecutionAsserter hasNoAuthenticatedTenantId() {
return new DelegateExecutionAsserter() {
@Override
public void doAssert(DelegateExecution execution) {
IdentityService identityService = execution.getProcessEngineServices().getIdentityService();
Authentication currentAuthentication = identityService.getCurrentAuthentication();
assertThat(currentAuthentication, is(nullValue()));
}
};
}
use of org.camunda.bpm.engine.test.api.delegate.AssertingJavaDelegate.DelegateExecutionAsserter in project camunda-bpm-platform by camunda.
the class DelegateExecutionHierarchyTest method testSingleNonScopeActivity.
public void testSingleNonScopeActivity() {
deployment(Bpmn.createExecutableProcess("testProcess").startEvent().serviceTask().camundaClass(AssertingJavaDelegate.class.getName()).endEvent().done());
AssertingJavaDelegate.addAsserts(new DelegateExecutionAsserter() {
public void doAssert(DelegateExecution execution) {
assertEquals(execution, execution.getProcessInstance());
assertNull(execution.getSuperExecution());
}
});
runtimeService.startProcessInstanceByKey("testProcess");
}
use of org.camunda.bpm.engine.test.api.delegate.AssertingJavaDelegate.DelegateExecutionAsserter in project camunda-bpm-platform by camunda.
the class DelegateExecutionHierarchyTest method testSubProcessInstance.
public void testSubProcessInstance() {
deployment(Bpmn.createExecutableProcess("testProcess").startEvent().callActivity().calledElement("testProcess2").endEvent().done(), Bpmn.createExecutableProcess("testProcess2").startEvent().serviceTask().camundaClass(AssertingJavaDelegate.class.getName()).endEvent().done());
AssertingJavaDelegate.addAsserts(new DelegateExecutionAsserter() {
public void doAssert(DelegateExecution execution) {
assertTrue(execution.equals(execution.getProcessInstance()));
assertNotNull(execution.getSuperExecution());
}
});
runtimeService.startProcessInstanceByKey("testProcess");
}
Aggregations