use of org.orcid.persistence.jpa.entities.SalesForceConnectionEntity in project ORCID-Source by ORCID.
the class SalesForceManagerImpl method enableAccess.
@Override
public void enableAccess(String accountId, List<Contact> contactsList) {
contactsList.forEach(c -> {
String orcid = c.getOrcid();
if (orcid == null) {
return;
}
SalesForceConnectionEntity connection = salesForceConnectionDao.findByOrcidAndAccountId(orcid, accountId);
if (connection == null) {
connection = new SalesForceConnectionEntity();
connection.setOrcid(orcid);
connection.setSalesForceAccountId(accountId);
connection.setEmail(c.getEmail());
salesForceConnectionDao.persist(connection);
}
});
}
use of org.orcid.persistence.jpa.entities.SalesForceConnectionEntity in project ORCID-Source by ORCID.
the class SalesForceManagerImplTest method setUpUser.
private void setUpUser() {
when(sourceManager.retrieveRealUserOrcid()).thenReturn(TEST_ORCID);
SalesForceConnectionEntity connection = new SalesForceConnectionEntity();
connection.setSalesForceAccountId("account1Id");
when(salesForceConnectionDao.findByOrcid(TEST_ORCID)).thenReturn(connection);
}
Aggregations