use of org.talend.components.salesforce.test.SalesforceRuntimeTestUtil in project components by Talend.
the class SalesforceProxyTestIT method testProxyWithBulkQuery.
@Test
public void testProxyWithBulkQuery() {
TSalesforceInputDefinition definition = (TSalesforceInputDefinition) getComponentService().getComponentDefinition(TSalesforceInputDefinition.COMPONENT_NAME);
TSalesforceInputProperties properties = (TSalesforceInputProperties) definition.createRuntimeProperties();
properties.connection.bulkConnection.setValue(true);
properties.queryMode.setValue(QueryMode.Bulk);
SalesforceRuntimeTestUtil util = new SalesforceRuntimeTestUtil();
properties.module.moduleName.setValue(util.getTestModuleName());
properties.module.main.schema.setValue(util.getTestSchema1());
properties.connection.userPassword.userId.setValue(userId);
properties.connection.userPassword.password.setValue(password);
properties.connection.userPassword.securityKey.setValue(securityKey);
Source source = new SalesforceSource();
source.initialize(null, properties);
org.talend.daikon.properties.ValidationResult vr = source.validate(null);
Assert.assertEquals(ValidationResult.Result.OK, vr.getStatus());
Reader reader = source.createReader(null);
try {
reader.start();
do {
reader.getCurrent();
} while (reader.advance());
reader.close();
} catch (Exception e) {
Assert.fail(e.getMessage());
}
}
Aggregations