提交 56348065 编写于 作者: J Joram Barrez

Fixing all failing REST unit tests on v6

上级 4ce21dcd
......@@ -15,6 +15,8 @@ package org.activiti.bpmn.model;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnore;
/**
* @author Tijs Rademakers
*/
......@@ -24,6 +26,8 @@ public class ActivitiListener extends BaseElement {
protected String implementationType;
protected String implementation;
protected List<FieldExtension> fieldExtensions = new ArrayList<FieldExtension>();
@JsonIgnore
protected Object instance; // Can be used to set an instance of the listener directly. That instance will then always be reused.
public String getEvent() {
......
......@@ -15,14 +15,14 @@ package org.activiti.bpmn.model;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnore;
/**
* @author Tijs Rademakers
* @author Joram Barrez
*/
public abstract class FlowNode extends FlowElement {
protected Object behavior;
protected SubProcess subProcess;
protected boolean asynchronous;
......@@ -30,6 +30,9 @@ public abstract class FlowNode extends FlowElement {
protected List<SequenceFlow> incomingFlows = new ArrayList<SequenceFlow>();
protected List<SequenceFlow> outgoingFlows = new ArrayList<SequenceFlow>();
@JsonIgnore
protected Object behavior;
public FlowNode() {
......
......@@ -15,6 +15,8 @@ package org.activiti.bpmn.model;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnore;
/**
* @author Tijs Rademakers
* @author Joram Barrez
......@@ -28,7 +30,10 @@ public class SequenceFlow extends FlowElement {
// Actual flow elements that match the source and target ref
// Set during process definition parsing
@JsonIgnore
protected FlowElement sourceFlowElement;
@JsonIgnore
protected FlowElement targetFlowElement;
/**
......
......@@ -41,6 +41,7 @@ import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.rest.WebConfigurer;
import org.activiti.rest.conf.ApplicationConfiguration;
import org.activiti.rest.service.api.RestUrlBuilder;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpResponse;
......@@ -256,7 +257,14 @@ public class BaseSpringRestTestCase extends PvmTestCase {
}
response = client.execute(request);
Assert.assertNotNull(response.getStatusLine());
Assert.assertEquals(expectedStatusCode, response.getStatusLine().getStatusCode());
int responseStatusCode = response.getStatusLine().getStatusCode();
if (expectedStatusCode != responseStatusCode) {
log.info("Wrong status code : " + responseStatusCode + ", but should be " + expectedStatusCode);
log.info("Response body: " + IOUtils.toString(response.getEntity().getContent()));
}
Assert.assertEquals(expectedStatusCode, responseStatusCode);
httpResponses.add(response);
return response;
......
......@@ -44,12 +44,15 @@ public class ExecutionCollectionResourceTest extends BaseSpringRestTestCase {
String id = processInstance.getId();
runtimeService.addUserIdentityLink(id, "kermit", "whatever");
Execution childExecution = runtimeService.createExecutionQuery().activityId("processTask").singleResult();
assertNotNull(childExecution);
Execution childExecutionInTask = runtimeService.createExecutionQuery().activityId("processTask").singleResult();
assertNotNull(childExecutionInTask);
Execution childExecutionInSubProcess = runtimeService.createExecutionQuery().activityId("subProcess").singleResult();
assertNotNull(childExecutionInSubProcess);
// Test without any parameters
String url = RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION_COLLECTION);
assertResultsPresentInDataResponse(url, id, childExecution.getId());
assertResultsPresentInDataResponse(url, id, childExecutionInTask.getId(), childExecutionInSubProcess.getId());
// Process instance id
url = RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION_COLLECTION) + "?id=" + id;
......@@ -67,35 +70,35 @@ public class ExecutionCollectionResourceTest extends BaseSpringRestTestCase {
// Process definition key
url = RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION_COLLECTION) + "?processDefinitionKey=processOne";
assertResultsPresentInDataResponse(url, id, childExecution.getId());
assertResultsPresentInDataResponse(url, id, childExecutionInTask.getId(), childExecutionInSubProcess.getId());
url = RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION_COLLECTION) + "?processDefinitionKey=processTwo";
assertResultsPresentInDataResponse(url);
// Process definition id
url = RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION_COLLECTION) + "?processDefinitionId=" + processInstance.getProcessDefinitionId();
assertResultsPresentInDataResponse(url, id, childExecution.getId());
assertResultsPresentInDataResponse(url, id, childExecutionInTask.getId(), childExecutionInSubProcess.getId());
url = RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION_COLLECTION) + "?processDefinitionId=anotherId";
assertResultsPresentInDataResponse(url);
// Parent id
url = RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION_COLLECTION) + "?parentId=" + id;
assertResultsPresentInDataResponse(url, childExecution.getId());
assertResultsPresentInDataResponse(url, childExecutionInSubProcess.getId());
url = RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION_COLLECTION) + "?parentId=anotherId";
assertResultsPresentInDataResponse(url);
// Activity id
url = RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION_COLLECTION) + "?activityId=processTask";
assertResultsPresentInDataResponse(url, childExecution.getId());
assertResultsPresentInDataResponse(url, childExecutionInTask.getId());
url = RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION_COLLECTION) + "?activityId=anotherId";
assertResultsPresentInDataResponse(url);
// Without tenant ID, before tenant is set
url = RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION_COLLECTION) + "?withoutTenantId=true";
assertResultsPresentInDataResponse(url, id, childExecution.getId());
assertResultsPresentInDataResponse(url, id, childExecutionInTask.getId(), childExecutionInSubProcess.getId());
// Update the tenant for the deployment
managementService.executeCommand(new ChangeDeploymentTenantIdCmd(deploymentId, "myTenant"));
......@@ -106,14 +109,14 @@ public class ExecutionCollectionResourceTest extends BaseSpringRestTestCase {
// Tenant id
url = RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION_COLLECTION) + "?tenantId=myTenant";
assertResultsPresentInDataResponse(url, id, childExecution.getId());
assertResultsPresentInDataResponse(url, id, childExecutionInTask.getId(), childExecutionInSubProcess.getId());
url = RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION_COLLECTION) + "?tenantId=myTenant2";
assertResultsPresentInDataResponse(url);
// Tenant id like
url = RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION_COLLECTION) + "?tenantIdLike=" + encode("%enant");
assertResultsPresentInDataResponse(url, id, childExecution.getId());
assertResultsPresentInDataResponse(url, id, childExecutionInTask.getId(), childExecutionInSubProcess.getId());
url = RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION_COLLECTION) + "?tenantIdLike=" + encode("%whatever");
assertResultsPresentInDataResponse(url);
......@@ -143,7 +146,6 @@ public class ExecutionCollectionResourceTest extends BaseSpringRestTestCase {
// Check if process is moved on to the other wait-state
waitingExecution = runtimeService.createExecutionQuery().activityId("anotherWaitState").singleResult();
assertNotNull(waitingExecution);
assertEquals(signalExecution.getId(), waitingExecution.getId());
}
/**
......@@ -177,7 +179,6 @@ public class ExecutionCollectionResourceTest extends BaseSpringRestTestCase {
// Check if process is moved on to the other wait-state
waitingExecution = runtimeService.createExecutionQuery().activityId("anotherWaitState").singleResult();
assertNotNull(waitingExecution);
assertEquals(signalExecution.getId(), waitingExecution.getId());
Map<String, Object> vars = runtimeService.getVariables(waitingExecution.getId());
assertEquals(1, vars.size());
......
......@@ -41,6 +41,10 @@ public class ExecutionQueryResourceTest extends BaseSpringRestTestCase {
processVariables.put("booleanVar", false);
Execution parentExecution = runtimeService.startProcessInstanceByKey("processOne", processVariables);
Execution subProcessExecution = runtimeService.createExecutionQuery().activityId("subProcess").singleResult();
assertNotNull(subProcessExecution);
Execution childExecution = runtimeService.createExecutionQuery().activityId("processTask").singleResult();
assertNotNull(childExecution);
......@@ -125,61 +129,61 @@ public class ExecutionQueryResourceTest extends BaseSpringRestTestCase {
variableNode.put("name", "stringVar");
variableNode.put("value", "Azerty");
variableNode.put("operation", "equals");
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), parentExecution.getId());
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), subProcessExecution.getId(), parentExecution.getId());
// Integer equals
variableNode.removeAll();
variableNode.put("name", "intVar");
variableNode.put("value", 67890);
variableNode.put("operation", "equals");
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), parentExecution.getId());
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), subProcessExecution.getId(), parentExecution.getId());
// Boolean equals
variableNode.removeAll();
variableNode.put("name", "booleanVar");
variableNode.put("value", false);
variableNode.put("operation", "equals");
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), parentExecution.getId());
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), subProcessExecution.getId(), parentExecution.getId());
// String not equals
variableNode.removeAll();
variableNode.put("name", "stringVar");
variableNode.put("value", "ghijkl");
variableNode.put("operation", "notEquals");
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), parentExecution.getId());
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), subProcessExecution.getId(), parentExecution.getId());
// Integer not equals
variableNode.removeAll();
variableNode.put("name", "intVar");
variableNode.put("value", 45678);
variableNode.put("operation", "notEquals");
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), parentExecution.getId());
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), subProcessExecution.getId(), parentExecution.getId());
// Boolean not equals
variableNode.removeAll();
variableNode.put("name", "booleanVar");
variableNode.put("value", true);
variableNode.put("operation", "notEquals");
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), parentExecution.getId());
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), subProcessExecution.getId(), parentExecution.getId());
// String equals ignore case
variableNode.removeAll();
variableNode.put("name", "stringVar");
variableNode.put("value", "azeRTY");
variableNode.put("operation", "equalsIgnoreCase");
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), parentExecution.getId());
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), subProcessExecution.getId(), parentExecution.getId());
// String not equals ignore case
variableNode.removeAll();
variableNode.put("name", "stringVar");
variableNode.put("value", "HIJKLm");
variableNode.put("operation", "notEqualsIgnoreCase");
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), parentExecution.getId());
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), subProcessExecution.getId(), parentExecution.getId());
// String equals without name
variableNode.removeAll();
variableNode.put("value", "Azerty");
variableNode.put("operation", "equals");
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), parentExecution.getId());
assertResultsPresentInPostDataResponse(url, requestNode, childExecution.getId(), subProcessExecution.getId(), parentExecution.getId());
}
}
......@@ -41,25 +41,29 @@ public class ExecutionResourceTest extends BaseSpringRestTestCase {
*/
@Deployment(resources = { "org/activiti/rest/service/api/runtime/ExecutionResourceTest.process-with-subprocess.bpmn20.xml" })
public void testGetExecution() throws Exception {
Execution parentExecution = runtimeService.startProcessInstanceByKey("processOne");
Execution processInstanceExecution = runtimeService.startProcessInstanceByKey("processOne");
Execution subProcessExecution = runtimeService.createExecutionQuery().activityId("subProcess").singleResult();
assertNotNull(subProcessExecution);
Execution childExecution = runtimeService.createExecutionQuery().activityId("processTask").singleResult();
assertNotNull(childExecution);
CloseableHttpResponse response = executeRequest(new HttpGet(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION, parentExecution.getId())), HttpStatus.SC_OK);
CloseableHttpResponse response = executeRequest(new HttpGet(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION, processInstanceExecution.getId())), HttpStatus.SC_OK);
// Check resulting parent execution
JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
closeResponse(response);
assertNotNull(responseNode);
assertEquals(parentExecution.getId(), responseNode.get("id").textValue());
assertEquals(processInstanceExecution.getId(), responseNode.get("id").textValue());
assertTrue(responseNode.get("activityId").isNull());
assertFalse(responseNode.get("suspended").booleanValue());
assertTrue(responseNode.get("parentUrl").isNull());
assertFalse(responseNode.get("suspended").booleanValue());
assertTrue(responseNode.get("url").asText().endsWith(RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION, parentExecution.getId())));
assertTrue(responseNode.get("url").asText().endsWith(RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION, processInstanceExecution.getId())));
assertTrue(responseNode.get("processInstanceUrl").asText().endsWith(RestUrls.createRelativeResourceUrl(RestUrls.URL_PROCESS_INSTANCE, parentExecution.getId())));
assertTrue(responseNode.get("processInstanceUrl").asText().endsWith(RestUrls.createRelativeResourceUrl(RestUrls.URL_PROCESS_INSTANCE, processInstanceExecution.getId())));
// Check resulting child execution
response = executeRequest(new HttpGet(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION, childExecution.getId())), HttpStatus.SC_OK);
......@@ -74,9 +78,9 @@ public class ExecutionResourceTest extends BaseSpringRestTestCase {
assertTrue(responseNode.get("url").asText().endsWith(RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION, childExecution.getId())));
assertTrue(responseNode.get("parentUrl").asText().endsWith(RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION, parentExecution.getId())));
assertTrue(responseNode.get("parentUrl").asText().endsWith(RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION, subProcessExecution.getId())));
assertTrue(responseNode.get("processInstanceUrl").asText().endsWith(RestUrls.createRelativeResourceUrl(RestUrls.URL_PROCESS_INSTANCE, parentExecution.getId())));
assertTrue(responseNode.get("processInstanceUrl").asText().endsWith(RestUrls.createRelativeResourceUrl(RestUrls.URL_PROCESS_INSTANCE, processInstanceExecution.getId())));
}
/**
......@@ -92,7 +96,9 @@ public class ExecutionResourceTest extends BaseSpringRestTestCase {
*/
@Deployment(resources = { "org/activiti/rest/service/api/runtime/ExecutionResourceTest.process-with-signal.bpmn20.xml" })
public void testSignalExecution() throws Exception {
Execution signalExecution = runtimeService.startProcessInstanceByKey("processOne");
runtimeService.startProcessInstanceByKey("processOne");
Execution signalExecution = runtimeService.createExecutionQuery().activityId("waitState").singleResult();
assertNotNull(signalExecution);
assertEquals("waitState", signalExecution.getActivityId());
......@@ -142,13 +148,12 @@ public class ExecutionResourceTest extends BaseSpringRestTestCase {
// Sending signal event causes the execution to end (scope-execution for
// the catching event)
httpPut.setEntity(new StringEntity(requestNode.toString()));
response = executeRequest(httpPut, HttpStatus.SC_NO_CONTENT);
response = executeRequest(httpPut, HttpStatus.SC_OK);
closeResponse(response);
// Check if process is moved on to the other wait-state
waitingExecution = runtimeService.createExecutionQuery().activityId("anotherWaitState").singleResult();
assertNotNull(waitingExecution);
assertEquals(signalExecution.getId(), waitingExecution.getId());
}
......@@ -178,13 +183,12 @@ public class ExecutionResourceTest extends BaseSpringRestTestCase {
// the catching event)
HttpPut httpPut = new HttpPut(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION, waitingExecution.getId()));
httpPut.setEntity(new StringEntity(requestNode.toString()));
CloseableHttpResponse response = executeRequest(httpPut, HttpStatus.SC_NO_CONTENT);
CloseableHttpResponse response = executeRequest(httpPut, HttpStatus.SC_OK);
closeResponse(response);
// Check if process is moved on to the other wait-state
waitingExecution = runtimeService.createExecutionQuery().activityId("anotherWaitState").singleResult();
assertNotNull(waitingExecution);
assertEquals(signalExecution.getId(), waitingExecution.getId());
Map<String, Object> vars = runtimeService.getVariables(waitingExecution.getId());
assertEquals(1, vars.size());
......@@ -216,13 +220,12 @@ public class ExecutionResourceTest extends BaseSpringRestTestCase {
// Sending signal event causes the execution to end (scope-execution for
// the catching event)
httpPut.setEntity(new StringEntity(requestNode.toString()));
response = executeRequest(httpPut, HttpStatus.SC_NO_CONTENT);
response = executeRequest(httpPut, HttpStatus.SC_OK);
closeResponse(response);
// Check if process is moved on to the other wait-state
waitingExecution = runtimeService.createExecutionQuery().activityId("anotherWaitState").singleResult();
assertNotNull(waitingExecution);
assertEquals(execution.getId(), waitingExecution.getId());
}
/**
......@@ -251,13 +254,12 @@ public class ExecutionResourceTest extends BaseSpringRestTestCase {
// the catching event)
HttpPut httpPut = new HttpPut(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_EXECUTION, waitingExecution.getId()));
httpPut.setEntity(new StringEntity(requestNode.toString()));
CloseableHttpResponse response = executeRequest(httpPut, HttpStatus.SC_NO_CONTENT);
CloseableHttpResponse response = executeRequest(httpPut, HttpStatus.SC_OK);
closeResponse(response);
// Check if process is moved on to the other wait-state
waitingExecution = runtimeService.createExecutionQuery().activityId("anotherWaitState").singleResult();
assertNotNull(waitingExecution);
assertEquals(signalExecution.getId(), waitingExecution.getId());
Map<String, Object> vars = runtimeService.getVariables(waitingExecution.getId());
assertEquals(1, vars.size());
......
......@@ -239,7 +239,6 @@ public class ProcessInstanceCollectionResourceTest extends BaseSpringRestTestCas
assertNotNull(responseNode);
assertEquals(processInstance.getId(), responseNode.get("id").textValue());
assertTrue(responseNode.get("businessKey").isNull());
assertEquals("processTask", responseNode.get("activityId").textValue());
assertFalse(responseNode.get("suspended").booleanValue());
assertTrue(responseNode.get("url").asText().endsWith(RestUrls.createRelativeResourceUrl(RestUrls.URL_PROCESS_INSTANCE, processInstance.getId())));
......@@ -260,7 +259,6 @@ public class ProcessInstanceCollectionResourceTest extends BaseSpringRestTestCas
assertNotNull(responseNode);
assertEquals(processInstance.getId(), responseNode.get("id").textValue());
assertTrue(responseNode.get("businessKey").isNull());
assertEquals("processTask", responseNode.get("activityId").textValue());
assertFalse(responseNode.get("suspended").booleanValue());
assertTrue(responseNode.get("url").asText().endsWith(RestUrls.createRelativeResourceUrl(RestUrls.URL_PROCESS_INSTANCE, processInstance.getId())));
......@@ -281,7 +279,6 @@ public class ProcessInstanceCollectionResourceTest extends BaseSpringRestTestCas
assertNotNull(responseNode);
assertEquals(processInstance.getId(), responseNode.get("id").textValue());
assertTrue(responseNode.get("businessKey").isNull());
assertEquals("processTask", responseNode.get("activityId").textValue());
assertFalse(responseNode.get("suspended").booleanValue());
assertTrue(responseNode.get("url").asText().endsWith(RestUrls.createRelativeResourceUrl(RestUrls.URL_PROCESS_INSTANCE, processInstance.getId())));
......@@ -358,7 +355,6 @@ public class ProcessInstanceCollectionResourceTest extends BaseSpringRestTestCas
JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
closeResponse(response);
assertEquals("processTask", responseNode.get("activityId").asText());
assertEquals(false, responseNode.get("ended").asBoolean());
JsonNode variablesArrayNode = responseNode.get("variables");
assertEquals(0, variablesArrayNode.size());
......@@ -409,7 +405,6 @@ public class ProcessInstanceCollectionResourceTest extends BaseSpringRestTestCas
CloseableHttpResponse response = executeRequest(httpPost, HttpStatus.SC_CREATED);
JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
closeResponse(response);
assertEquals("processTask", responseNode.get("activityId").asText());
assertEquals(false, responseNode.get("ended").asBoolean());
JsonNode variablesArrayNode = responseNode.get("variables");
assertEquals(2, variablesArrayNode.size());
......
......@@ -51,7 +51,6 @@ public class ProcessInstanceResourceTest extends BaseSpringRestTestCase {
assertNotNull(responseNode);
assertEquals(processInstance.getId(), responseNode.get("id").textValue());
assertEquals("myBusinessKey", responseNode.get("businessKey").textValue());
assertEquals("processTask", responseNode.get("activityId").textValue());
assertFalse(responseNode.get("suspended").booleanValue());
assertEquals("", responseNode.get("tenantId").textValue());
......
......@@ -17,6 +17,7 @@ import java.util.Calendar;
import java.util.List;
import org.activiti.engine.impl.cmd.ChangeDeploymentTenantIdCmd;
import org.activiti.engine.runtime.Execution;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.DelegationState;
import org.activiti.engine.task.IdentityLinkType;
......@@ -212,7 +213,8 @@ public class TaskCollectionResourceTest extends BaseSpringRestTestCase {
assertResultsPresentInDataResponse(url, processTask.getId());
// Execution filtering
url = RestUrls.createRelativeResourceUrl(RestUrls.URL_TASK_COLLECTION) + "?executionId=" + processInstance.getId();
Execution taskExecution = runtimeService.createExecutionQuery().activityId("processTask").singleResult();
url = RestUrls.createRelativeResourceUrl(RestUrls.URL_TASK_COLLECTION) + "?executionId=" + taskExecution.getId();
assertResultsPresentInDataResponse(url, processTask.getId());
// Process instance businesskey filtering
......
......@@ -19,6 +19,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import org.activiti.engine.runtime.Execution;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.DelegationState;
import org.activiti.engine.task.IdentityLinkType;
......@@ -177,7 +178,8 @@ public class TaskQueryResourceTest extends BaseSpringRestTestCase {
// Execution filtering
requestNode.removeAll();
requestNode.put("executionId", processInstance.getId());
Execution taskExecution = runtimeService.createExecutionQuery().activityId("processTask").singleResult();
requestNode.put("executionId", taskExecution.getId());
assertResultsPresentInPostDataResponse(url, requestNode, processTask.getId());
// Process instance businesskey filtering
......
......@@ -192,7 +192,6 @@ public class TaskVariablesCollectionResourceTest extends BaseSpringRestTestCase
assertNull(responseNode.get("valueUrl"));
assertTrue(runtimeService.hasVariable(task.getExecutionId(), "myVariable"));
assertEquals("Another simple string value", runtimeService.getVariableLocal(task.getExecutionId(), "myVariable"));
// Create a new scope-less variable, which defaults to local variables
variableNode.removeAll();
......
......@@ -23,13 +23,12 @@ public class MockEmailTransport extends Transport {
super(smtpSession, urlName);
}
@Override
public void sendMessage(Message message, Address[] addresses) throws MessagingException {
try {
logger.info(message.getContent().toString());
} catch (IOException ex) {
logger.error("Error occured while sending email" + ex);
}
@Override
public void sendMessage(Message message, Address[] addresses) throws MessagingException {
try {
logger.info(message.getContent().toString());
} catch (IOException ex) {
logger.error("Error occured while sending email" + ex);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册