Manage notification handler for Sensu

This patch adds two things:
  - the field 'handler' to an alarm. Now an alarm can be described as
        alarm_name:
            policy: name_of_policy
            alerting: enabled_with_notifications
            handler: mail
            ...
  - a new parameter 'notification_handler' to pass the handler that
    can now be added to an alarm.

Change-Id: I1e0767b3c1aa664110c97ae5f8fafc47c9682ab9
diff --git a/tests/lua/test_gse.lua b/tests/lua/test_gse.lua
index be892f5..b68986d 100644
--- a/tests/lua/test_gse.lua
+++ b/tests/lua/test_gse.lua
@@ -184,36 +184,39 @@
     end
 
     function TestGse:test_inject_cluster_metric_for_nova()
-        gse.inject_cluster_metric('nova', {key = "val"}, true)
+        gse.inject_cluster_metric('nova', {key = "val"}, true, true, 'mail')
         local metric = last_injected_msg
         assertEquals(metric.Type, 'gse_metric')
         assertEquals(metric.Fields.member, 'nova')
         assertEquals(metric.Fields.name, 'cluster_status')
         assertEquals(metric.Fields.value, consts.OKAY)
         assertEquals(metric.Fields.key, 'val')
+        assertEquals(metric.Fields.notification_handler, 'mail')
         assertEquals(metric.Payload, '{"alarms":[]}')
     end
 
     function TestGse:test_inject_cluster_metric_for_glance()
-        gse.inject_cluster_metric('glance', {key = "val"}, true)
+        gse.inject_cluster_metric('glance', {key = "val"}, false, false, 'mail')
         local metric = last_injected_msg
         assertEquals(metric.Type, 'gse_metric')
         assertEquals(metric.Fields.member, 'glance')
         assertEquals(metric.Fields.name, 'cluster_status')
         assertEquals(metric.Fields.value, consts.DOWN)
         assertEquals(metric.Fields.key, 'val')
+        assertEquals(metric.Fields.notification_handler, 'mail')
         assert(metric.Payload:match("glance%-registry endpoints are down"))
         assert(metric.Payload:match("glance%-api endpoint is down on node%-1"))
     end
 
     function TestGse:test_inject_cluster_metric_for_heat()
-        gse.inject_cluster_metric('heat', {key = "val"}, true)
+        gse.inject_cluster_metric('heat', {key = "val"}, true, true, 'mail')
         local metric = last_injected_msg
         assertEquals(metric.Type, 'gse_metric')
         assertEquals(metric.Fields.member, 'heat')
         assertEquals(metric.Fields.name, 'cluster_status')
         assertEquals(metric.Fields.value, consts.WARN)
         assertEquals(metric.Fields.key, 'val')
+        assertEquals(metric.Fields.notification_handler, 'mail')
         assert(metric.Payload:match("5xx errors detected"))
         assert(metric.Payload:match("1 RabbitMQ node out of 3 is down"))
     end