diff --git a/oap-server/server-alarm-plugin/src/test/java/org/apache/skywalking/oap/server/core/alarm/provider/WebhookCallbackTest.java b/oap-server/server-alarm-plugin/src/test/java/org/apache/skywalking/oap/server/core/alarm/provider/WebhookCallbackTest.java index 961acf7757a9..e3ef8b5fecf1 100644 --- a/oap-server/server-alarm-plugin/src/test/java/org/apache/skywalking/oap/server/core/alarm/provider/WebhookCallbackTest.java +++ b/oap-server/server-alarm-plugin/src/test/java/org/apache/skywalking/oap/server/core/alarm/provider/WebhookCallbackTest.java @@ -34,6 +34,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.skywalking.oap.server.core.alarm.AlarmMessage; +import org.apache.skywalking.oap.server.core.source.Scope; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; @@ -72,8 +73,14 @@ public void testWebhook() { remoteEndpoints.add("http://127.0.0.1:8778/webhook/receiveAlarm"); WebhookCallback webhookCallback = new WebhookCallback(remoteEndpoints); List alarmMessages = new ArrayList<>(2); - alarmMessages.add(new AlarmMessage()); - alarmMessages.add(new AlarmMessage()); + AlarmMessage alarmMessage = new AlarmMessage(); + alarmMessage.setScope(Scope.All); + alarmMessage.setAlarmMessage("alarmMessage with [Scope.All]"); + alarmMessages.add(alarmMessage); + AlarmMessage anotherAlarmMessage = new AlarmMessage(); + anotherAlarmMessage.setScope(Scope.Endpoint); + anotherAlarmMessage.setAlarmMessage("anotherAlarmMessage with [Scope.Endpoint]"); + alarmMessages.add(anotherAlarmMessage); webhookCallback.doAlarm(alarmMessages); Assert.assertTrue(isSuccess);