When running the tests for fflib-apex-common against a new production org we're getting a failure in the fflib_SecurityUtilsTest class
fflib_SecurityUtilsTest.readonly_objectAndField_access
System.AssertException: Assertion Failed: Read only profile should be able to read Contact: Expected: null, Actual: FlsException:[SecurityException.m_objectType=Contact, SecurityException.m_operation=READ, m_fieldToken=Birthdate]: You do not have permission to read the field Birthdate on Contact
Class.fflib_SecurityUtilsTest.readonly_objectAndField_access: line 261, column
It appears that the new org includes a Read Only profile but that profile does not include visibility on the Contact.Birthdate field like the test is expecting.
I'm seeing a similar configuration in new trial orgs.
A suggested fix to this is to assign the "ReadOnlyPermissionSet" to the RunAs user test user regardless of whether the setupTestUser() method assigns the Read Only or Minimum Access - Salesforce profiles.
When running the tests for fflib-apex-common against a new production org we're getting a failure in the fflib_SecurityUtilsTest class
fflib_SecurityUtilsTest.readonly_objectAndField_access
System.AssertException: Assertion Failed: Read only profile should be able to read Contact: Expected: null, Actual: FlsException:[SecurityException.m_objectType=Contact, SecurityException.m_operation=READ, m_fieldToken=Birthdate]: You do not have permission to read the field Birthdate on Contact Class.fflib_SecurityUtilsTest.readonly_objectAndField_access: line 261, column
It appears that the new org includes a Read Only profile but that profile does not include visibility on the Contact.Birthdate field like the test is expecting.
I'm seeing a similar configuration in new trial orgs.
A suggested fix to this is to assign the "ReadOnlyPermissionSet" to the RunAs user test user regardless of whether the
setupTestUser()
method assigns theRead Only
orMinimum Access - Salesforce
profiles.