use of com.force.api.ApiConfig in project syndesis-qe by syndesisio.
the class SalesforceAccount method getInstance.
public static ForceApi getInstance() {
if (salesforce == null) {
final Account salesforceAccount = AccountsDirectory.getInstance().get(Account.Name.SALESFORCE);
TestUtils.withRetry(() -> {
try {
salesforce = new ForceApi(new ApiConfig().setClientId(salesforceAccount.getProperty("clientId")).setClientSecret(salesforceAccount.getProperty("clientSecret")).setUsername(salesforceAccount.getProperty("userName")).setPassword(salesforceAccount.getProperty("password")).setForceURL(salesforceAccount.getProperty("loginUrl")));
return true;
} catch (Exception ex) {
log.error("Unable to connect to salesforce, will retry in 5 minutes");
return false;
}
}, 3, 300000L, "Unable to connect to SalesForce");
}
return salesforce;
}