use of org.orcid.core.salesforce.dao.SalesForceDao in project ORCID-Source by ORCID.
the class GetSalesForceAccessToken method main.
@SuppressWarnings("resource")
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext("orcid-core-context.xml");
SalesForceDao salesForceDao = (SalesForceDao) context.getBean("salesForceDao");
String accessToken = salesForceDao.getAccessToken();
System.out.println(accessToken);
System.exit(0);
}
use of org.orcid.core.salesforce.dao.SalesForceDao in project ORCID-Source by ORCID.
the class SalesForceManagerImplTest method testUpdateContact2.
@Test
public void testUpdateContact2() {
// Switch from main to technical contact
Contact contact = new Contact();
contact.setId("contact2Id");
contact.setAccountId("account1");
ContactRole role = new ContactRole(ContactRoleType.TECHNICAL_CONTACT);
role.setId("contact2Idrole1Id");
contact.setRole(role);
salesForceManager.updateContact(contact);
verify(salesForceDao, times(1)).createContactRole(argThat(r -> {
return "contact2Id".equals(r.getContactId()) && "account1Id".equals(r.getAccountId()) && ContactRoleType.TECHNICAL_CONTACT.equals(r.getRoleType());
}));
verify(salesForceDao, times(1)).removeContactRole(eq("contact2Idrole1Id"));
}
Aggregations