Hi Hari,
What version of Activiti are you running this test case on? I am able to run the test case on Activiti 6 successfully and have validated the behavior is correct by tweaking the test case as shown below. FWIW, I am running the test case from within the Activiti test suite using the SkipExpressionUserTaskTest.
@Deployment
public void test2() {
HashMap<String,Object> mpvar = new HashMap<String,Object>();
mpvar.put("fname", "Hari");
mpvar.put("_ACTIVITI_SKIP_EXPRESSION_ENABLED", true);
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("TestSkipExp",mpvar);
System.out.println("STARTED PROCESS");
System.out.println("====================================================================================================");
assertNotNull(processInstance);
List<Task> tasks = taskService.createTaskQuery().taskAssignee("Hari").list();
assertEquals(1, tasks.size());
assertEquals("UT2", tasks.get(0).getTaskDefinitionKey());
for(Task t:tasks){
System.out.println(t.getTaskDefinitionKey() + " " + t.getName());
}
taskService.complete(tasks.get(0).getId());
assertNull(runtimeService.createProcessInstanceQuery().processInstanceId(processInstance.getId()).singleResult());
System.out.println("END");
System.out.println("====================================================================================================");
}
thanks,
Rob