'Assert if the generated notification matches with the stored sample
:param sample_file_name: The name of the sample file to match relative
to doc/notification_samples
:param replacements: A dict of key value pairs that is used to update
the payload field of the sample data before it is
matched against the generated notification.
The \'x.y\':\'new-value\' key-value pair selects the
["payload"]["nova_object.data"]["x"]
["nova_object.data"]["y"] value from the sample
data and overrides it with \'new-value\'. There is
a special value ANY that can be used to indicate
that the actual field value shall be ignored
during matching.
:param actual: Defines the actual notification to compare with. If
None then it defaults to the first versioned
notification emitted during the test.'

def _verify_notification(self, sample_file_name, replacements=None, actual=None):

    if (not actual):
        self.assertEqual(1, len(fake_notifier.VERSIONED_NOTIFICATIONS))
        notification = fake_notifier.VERSIONED_NOTIFICATIONS[0]
    else:
        notification = actual
    with open(self._get_notification_sample(sample_file_name)) as sample:
        sample_data = sample.read()
    sample_obj = jsonutils.loads(sample_data)
    self._apply_replacements(replacements, sample_obj, notification)
    self.assertJsonEqual(sample_obj, notification)
