updated tests to return error codes when test cases call for mock identity to return error codes