use of org.apache.camel.component.salesforce.api.dto.approval.ApprovalRequest in project camel by apache.
the class ApprovalIntegrationTest method shouldSubmitBulkApprovals.
@Test
public void shouldSubmitBulkApprovals() {
final List<ApprovalRequest> approvalRequests = accountIds.stream().map(id -> {
final ApprovalRequest request = new ApprovalRequest();
request.setContextId(id);
request.setComments("Approval for " + id);
request.setActionType(Action.Submit);
return request;
}).collect(Collectors.toList());
final ApprovalResult approvalResult = template.requestBody(String.format(//
"salesforce:approval?" + //
"format=%s" + //
"&approvalActionType=Submit" + //
"&approvalNextApproverIds=%s" + "&approvalProcessDefinitionNameOrId=Test_Account_Process", format, userId), approvalRequests, ApprovalResult.class);
assertEquals("Should have same number of approval results as requests", approvalRequests.size(), approvalResult.size());
}
use of org.apache.camel.component.salesforce.api.dto.approval.ApprovalRequest in project camel by apache.
the class ApprovalExamplesIntegrationTest method createRegistry.
@Override
protected JndiRegistry createRegistry() throws Exception {
final JndiRegistry jndi = super.createRegistry();
final ApprovalRequest approvalTemplate = new ApprovalRequest();
approvalTemplate.setActionType(ApprovalRequest.Action.Submit);
approvalTemplate.setComments("Sample approval template");
approvalTemplate.setProcessDefinitionNameOrId("Test_Account_Process");
approvalTemplate.setSkipEntryCriteria(true);
jndi.bind("approvalTemplate", approvalTemplate);
return jndi;
}
Aggregations