use of org.apache.camel.component.salesforce.api.dto.approval.ApprovalRequest in project camel by apache.
the class AbstractRestProcessorApprovalTest method shouldFetchApprovalRequestFromHeader.
@Test
public void shouldFetchApprovalRequestFromHeader() throws SalesforceException {
final ApprovalRequest request = new ApprovalRequest();
request.setComments("hi there");
final TestRestProcessor processor = sendBodyAndHeader(null, request);
verify(processor).getRequestStream(new ApprovalRequests(request));
}
use of org.apache.camel.component.salesforce.api.dto.approval.ApprovalRequest in project camel by apache.
the class AbstractRestProcessorApprovalTest method requestWithComment.
static ApprovalRequest requestWithComment(final String comment) {
final ApprovalRequest approvalRequest = new ApprovalRequest();
approvalRequest.setComments(comment);
return approvalRequest;
}
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;
}
use of org.apache.camel.component.salesforce.api.dto.approval.ApprovalRequest in project camel by apache.
the class AbstractRestProcessorApprovalTest method shouldFetchApprovalRequestFromHeaderEvenIfBodyIsDefinedButNotConvertable.
@Test
public void shouldFetchApprovalRequestFromHeaderEvenIfBodyIsDefinedButNotConvertable() throws SalesforceException {
final ApprovalRequest request = new ApprovalRequest();
request.setComments("hi there");
final TestRestProcessor processor = sendBodyAndHeaders("Nothing to see here", request, Collections.singletonMap("approval.ContextId", "context-id"));
final ApprovalRequest combined = new ApprovalRequest();
combined.setComments("hi there");
combined.setContextId("context-id");
verify(processor).getRequestStream(new ApprovalRequests(combined));
}
Aggregations