Skip to content

Commit 3cbfe17

Browse files
Add unit-tests for NotificationComponent
This includes a few common scenarios and a reproduction of the current behavior affected by the underlying bug of issue #10575. This is done both to document the change in behavior, as well as to ensure the behavior of the other scenarios stays the same before and after the fix is applied.
1 parent da9ed76 commit 3cbfe17

File tree

3 files changed

+499
-0
lines changed

3 files changed

+499
-0
lines changed

test/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ set(base_test_SOURCES
118118
icinga-notification.cpp
119119
icinga-perfdata.cpp
120120
methods-pluginnotificationtask.cpp
121+
notification-notificationcomponent.cpp
121122
remote-certificate-fixture.cpp
122123
remote-filterutility.cpp
123124
remote-configpackageutility.cpp
@@ -129,6 +130,7 @@ set(base_test_SOURCES
129130
$<TARGET_OBJECTS:remote>
130131
$<TARGET_OBJECTS:icinga>
131132
$<TARGET_OBJECTS:methods>
133+
$<TARGET_OBJECTS:notification>
132134
)
133135

134136
if(ICINGA2_UNITY_BUILD)

test/icinga-notification.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
#include "icinga/notificationcommand.hpp"
66
#include "icinga/service.hpp"
77
#include "icinga/user.hpp"
8+
#include "config/configcompiler.hpp"
9+
#include "notification/notificationcomponent.hpp"
10+
#include "remote/apilistener.hpp"
811
#include <BoostTestTargetConfig.h>
912
#include <iostream>
1013

0 commit comments

Comments
 (0)