Search in sources :

Example 1 with NotTaskListener

use of org.camunda.bpm.engine.test.cmmn.tasklistener.util.NotTaskListener in project camunda-bpm-platform by camunda.

the class TaskListenerTest method testDoesNotImplementTaskListenerInterfaceByDelegateExpression.

@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/tasklistener/TaskListenerTest.testDoesNotImplementTaskListenerInterfaceByDelegateExpression.cmmn" })
public void testDoesNotImplementTaskListenerInterfaceByDelegateExpression() {
    try {
        caseService.withCaseDefinitionByKey("case").setVariable("myTaskListener", new NotTaskListener()).create().getId();
        fail("exception expected");
    } catch (Exception e) {
        // then
        Throwable cause = e.getCause();
        String message = cause.getMessage();
        assertTextPresent("Delegate expression ${myTaskListener} did not resolve to an implementation of interface " + TaskListener.class.getName(), message);
    }
}
Also used : MySpecialTaskListener(org.camunda.bpm.engine.test.cmmn.tasklistener.util.MySpecialTaskListener) TaskListener(org.camunda.bpm.engine.delegate.TaskListener) FieldInjectionTaskListener(org.camunda.bpm.engine.test.cmmn.tasklistener.util.FieldInjectionTaskListener) NotTaskListener(org.camunda.bpm.engine.test.cmmn.tasklistener.util.NotTaskListener) MyTaskListener(org.camunda.bpm.engine.test.cmmn.tasklistener.util.MyTaskListener) NotTaskListener(org.camunda.bpm.engine.test.cmmn.tasklistener.util.NotTaskListener) Matchers.containsString(org.hamcrest.Matchers.containsString) ExpectedException(org.junit.rules.ExpectedException) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

TaskListener (org.camunda.bpm.engine.delegate.TaskListener)1 Deployment (org.camunda.bpm.engine.test.Deployment)1 FieldInjectionTaskListener (org.camunda.bpm.engine.test.cmmn.tasklistener.util.FieldInjectionTaskListener)1 MySpecialTaskListener (org.camunda.bpm.engine.test.cmmn.tasklistener.util.MySpecialTaskListener)1 MyTaskListener (org.camunda.bpm.engine.test.cmmn.tasklistener.util.MyTaskListener)1 NotTaskListener (org.camunda.bpm.engine.test.cmmn.tasklistener.util.NotTaskListener)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 ExpectedException (org.junit.rules.ExpectedException)1