'Check whether mapped properties object has \'user\' within.
According to today\'s rules, RuleProcessor does not have to issue user\'s
id or name. What\'s actually required is user\'s type and for ephemeral
users that would be service domain named \'Federated\'.'

def assertValidMappedUserObject(self, mapped_properties, user_type='ephemeral', domain_id=None):

    self.assertIn('user', mapped_properties, message='Missing    user    object    in    mapped    properties')
    user = mapped_properties['user']
    self.assertIn('type', user)
    self.assertEqual(user_type, user['type'])
    self.assertIn('domain', user)
    domain = user['domain']
    domain_name_or_id = (domain.get('id') or domain.get('name'))
    domain_ref = (domain_id or 'Federated')
    self.assertEqual(domain_ref, domain_name_or_id)
