use of org.wildfly.camel.test.salesforce.dto.QueryRecordsOpportunity in project wildfly-camel by wildfly-extras.
the class SalesforceIntegrationTest method testSalesforceQueryProducer.
@Test
public void testSalesforceQueryProducer() throws Exception {
Map<String, Object> salesforceOptions = createSalesforceOptions();
Assume.assumeTrue("[#1676] Enable Salesforce testing in Jenkins", salesforceOptions.size() == SalesforceOption.values().length);
SalesforceLoginConfig loginConfig = new SalesforceLoginConfig();
IntrospectionSupport.setProperties(loginConfig, salesforceOptions);
SalesforceComponent component = new SalesforceComponent();
component.setPackages("org.wildfly.camel.test.salesforce.dto");
component.setLoginConfig(loginConfig);
CamelContext camelctx = new DefaultCamelContext();
camelctx.addComponent("salesforce", component);
camelctx.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:query").to("salesforce:query?sObjectQuery=SELECT id,name from Opportunity&sObjectClass=" + QueryRecordsOpportunity.class.getName());
}
});
camelctx.start();
try {
ProducerTemplate template = camelctx.createProducerTemplate();
QueryRecordsOpportunity queryRecords = template.requestBody("direct:query", null, QueryRecordsOpportunity.class);
Assert.assertNotNull("Expected query records result to not be null", queryRecords);
} finally {
camelctx.stop();
}
}
Aggregations