Modify Trigger dbus api

'AddTrigger' method is now using array of strings for actions instead
of boolean flags. The action names are following:
- 'UpdateReport' (same as old flag)
- 'LogToLogService' (old 'LogToJournal' flag)
- 'RedfishEvent' (old 'LogToRedfish' flag)
Additionally, isDiscrete flag was removed from 'AddTrigger' call, as
this value can be extracted depending on threshold.

As a result new 'AddTrigger" signature is: "sasa{os}asv"
Example call parameters:
- TestTrigger 1 UpdateReport 0 0 "a(stsd)" 1 LowerWarning 1000
  Either 42.7'
- TestTrigger 2 UpdateReport RedfishEvent 0 0 "a(ssts)" 1 userId_1
  Warning 10 15.2'

'Trigger' properties were also modified. Instead of action bool
properties (same as mentioned above), new property was introduced
'TriggerActions' - which has same values as those used in 'AddTrigger'
method. This also affects persistence: store/load functionality was
modified accordingly.

As a side change - isDiscrete is no longer stored, as this can be easily
recreated in the runtime.

Tested:
- Trigger was successfully created using dbus.
- busctl introspect was called on test trigger and properties are
  modified and working as intended.
- persistency mechanic is working propetly.

Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
Change-Id: Icd64d4032fd6d446d9b6ad248e28e9031af1fed7
diff --git a/tests/src/mocks/trigger_factory_mock.hpp b/tests/src/mocks/trigger_factory_mock.hpp
index 3682a46..3df567e 100644
--- a/tests/src/mocks/trigger_factory_mock.hpp
+++ b/tests/src/mocks/trigger_factory_mock.hpp
@@ -15,15 +15,15 @@
     {
         using namespace testing;
 
-        ON_CALL(*this, make(A<const std::string&>(), _, _, _, _, _, _, _, _, _))
+        ON_CALL(*this, make(A<const std::string&>(), _, _, _, _, _, _))
             .WillByDefault(WithArgs<0>(Invoke([](const std::string& name) {
                 return std::make_unique<NiceMock<TriggerMock>>(name);
             })));
     }
 
     MOCK_METHOD(std::unique_ptr<interfaces::Trigger>, make,
-                (const std::string& name, bool isDiscrete, bool logToJournal,
-                 bool logToRedfish, bool updateReport,
+                (const std::string& name,
+                 const std::vector<std::string>& triggerActions,
                  const std::vector<std::string>& reportNames,
                  interfaces::TriggerManager& triggerManager,
                  interfaces::JsonStorage& triggerStorage,
@@ -53,11 +53,9 @@
                 .WillByDefault(Return(params.sensors()));
 
             return EXPECT_CALL(
-                *this,
-                make(params.name(), params.isDiscrete(), params.logToJournal(),
-                     params.logToRedfish(), params.updateReport(),
-                     params.reportNames(), tm, triggerStorage,
-                     params.thresholdParams(), params.sensors()));
+                *this, make(params.name(), params.triggerActions(),
+                            params.reportNames(), tm, triggerStorage,
+                            params.thresholdParams(), params.sensors()));
         }
         else
         {
@@ -69,8 +67,8 @@
             ON_CALL(*this, getLabeledSensorsInfo(_, _))
                 .WillByDefault(Return(dummy));
 
-            return EXPECT_CALL(
-                *this, make(_, _, _, _, _, _, tm, triggerStorage, _, dummy));
+            return EXPECT_CALL(*this,
+                               make(_, _, _, tm, triggerStorage, _, dummy));
         }
     }
 };
diff --git a/tests/src/params/trigger_params.hpp b/tests/src/params/trigger_params.hpp
index 753cbb1..f2cac0e 100644
--- a/tests/src/params/trigger_params.hpp
+++ b/tests/src/params/trigger_params.hpp
@@ -22,36 +22,15 @@
         return nameProperty;
     }
 
-    TriggerParams& isDiscrete(bool val)
+    TriggerParams& triggerActions(const std::vector<std::string>& val)
     {
-        discreteProperty = val;
+        triggerActionsProperty = val;
         return *this;
     }
 
-    bool isDiscrete() const
+    const std::vector<std::string>& triggerActions() const
     {
-        return discreteProperty;
-    }
-
-    bool logToJournal() const
-    {
-        return logToJournalProperty;
-    }
-
-    bool logToRedfish() const
-    {
-        return logToRedfishProperty;
-    }
-
-    TriggerParams& updateReport(bool updateReport)
-    {
-        updateReportProperty = updateReport;
-        return *this;
-    }
-
-    bool updateReport() const
-    {
-        return updateReportProperty;
+        return triggerActionsProperty;
     }
 
     const std::vector<LabeledSensorInfo>& sensors() const
@@ -77,10 +56,8 @@
 
   private:
     std::string nameProperty = "Trigger1";
-    bool discreteProperty = false;
-    bool logToJournalProperty = false;
-    bool logToRedfishProperty = false;
-    bool updateReportProperty = true;
+    std::vector<std::string> triggerActionsProperty = {"UpdateReport"};
+
     std::vector<LabeledSensorInfo> labeledSensorsProperty = {
         {"service1", "/xyz/openbmc_project/sensors/temperature/BMC_Temp",
          "metadata1"}};
diff --git a/tests/src/test_trigger.cpp b/tests/src/test_trigger.cpp
index 7529017..3a9004f 100644
--- a/tests/src/test_trigger.cpp
+++ b/tests/src/test_trigger.cpp
@@ -23,7 +23,6 @@
     TriggerParams triggerDiscreteParams =
         TriggerParams()
             .name("Trigger2")
-            .isDiscrete(true)
             .thresholdParams(std::vector<discrete::LabeledThresholdParam>{
                 discrete::LabeledThresholdParam{
                     "userId", discrete::Severity::warning,
@@ -56,8 +55,7 @@
     {
         return std::make_unique<Trigger>(
             DbusEnvironment::getIoc(), DbusEnvironment::getObjServer(),
-            params.name(), params.isDiscrete(), params.logToJournal(),
-            params.logToRedfish(), params.updateReport(), params.reportNames(),
+            params.name(), params.triggerActions(), params.reportNames(),
             params.sensors(), params.thresholdParams(),
             std::vector<std::shared_ptr<interfaces::Threshold>>{},
             *triggerManagerMockPtr, storageMock);
@@ -122,14 +120,9 @@
 TEST_F(TestTrigger, checkIfPropertiesAreSet)
 {
     EXPECT_THAT(getProperty<bool>(sut->getPath(), "Persistent"), Eq(true));
-    EXPECT_THAT(getProperty<bool>(sut->getPath(), "Discrete"),
-                Eq(triggerParams.isDiscrete()));
-    EXPECT_THAT(getProperty<bool>(sut->getPath(), "LogToJournal"),
-                Eq(triggerParams.logToJournal()));
-    EXPECT_THAT(getProperty<bool>(sut->getPath(), "LogToRedfish"),
-                Eq(triggerParams.logToRedfish()));
-    EXPECT_THAT(getProperty<bool>(sut->getPath(), "UpdateReport"),
-                Eq(triggerParams.updateReport()));
+    EXPECT_THAT(
+        getProperty<std::vector<std::string>>(sut->getPath(), "TriggerActions"),
+        Eq(triggerParams.triggerActions()));
     EXPECT_THAT((getProperty<SensorsInfo>(sut->getPath(), "Sensors")),
                 Eq(utils::fromLabeledSensorsInfo(triggerParams.sensors())));
     EXPECT_THAT(
@@ -274,28 +267,10 @@
     ASSERT_THAT(storedConfiguration.at("Name"), Eq(triggerParams.name()));
 }
 
-TEST_F(TestTriggerStore, settingPersistencyToTrueStoresTriggerIsDiscrete)
+TEST_F(TestTriggerStore, settingPersistencyToTrueStoresTriggerTriggerActions)
 {
-    ASSERT_THAT(storedConfiguration.at("IsDiscrete"),
-                Eq(triggerParams.isDiscrete()));
-}
-
-TEST_F(TestTriggerStore, settingPersistencyToTrueStoresTriggerLogToJournal)
-{
-    ASSERT_THAT(storedConfiguration.at("LogToJournal"),
-                Eq(triggerParams.logToRedfish()));
-}
-
-TEST_F(TestTriggerStore, settingPersistencyToTrueStoresTriggerLogToRedfish)
-{
-    ASSERT_THAT(storedConfiguration.at("LogToRedfish"),
-                Eq(triggerParams.logToRedfish()));
-}
-
-TEST_F(TestTriggerStore, settingPersistencyToTrueStoresTriggerUpdateReport)
-{
-    ASSERT_THAT(storedConfiguration.at("UpdateReport"),
-                Eq(triggerParams.updateReport()));
+    ASSERT_THAT(storedConfiguration.at("TriggerActions"),
+                Eq(triggerParams.triggerActions()));
 }
 
 TEST_F(TestTriggerStore, settingPersistencyToTrueStoresTriggerReportNames)
diff --git a/tests/src/test_trigger_manager.cpp b/tests/src/test_trigger_manager.cpp
index 704c497..540bcbc 100644
--- a/tests/src/test_trigger_manager.cpp
+++ b/tests/src/test_trigger_manager.cpp
@@ -29,8 +29,7 @@
             },
             DbusEnvironment::serviceName(), TriggerManager::triggerManagerPath,
             TriggerManager::triggerManagerIfaceName, "AddTrigger",
-            params.name(), params.isDiscrete(), params.logToJournal(),
-            params.logToRedfish(), params.updateReport(), sensorInfos,
+            params.name(), params.triggerActions(), sensorInfos,
             params.reportNames(),
             std::visit(utils::FromLabeledThresholdParamConversion(),
                        params.thresholdParams()));
@@ -80,7 +79,7 @@
         {"discrete_threshold2", discrete::Severity::warning, 10, "12.0"},
         {"discrete_threshold3", discrete::Severity::critical, 10, "13.0"}};
 
-    triggerParamsDiscrete.thresholdParams(thresholds).isDiscrete(true);
+    triggerParamsDiscrete.thresholdParams(thresholds);
 
     auto [ec, path] = addTrigger(triggerParamsDiscrete);
     EXPECT_THAT(ec.value(), Eq(boost::system::errc::success));
@@ -92,7 +91,7 @@
     TriggerParams triggerParamsDiscrete;
     auto thresholds = std::vector<discrete::LabeledThresholdParam>();
 
-    triggerParamsDiscrete.thresholdParams(thresholds).isDiscrete(true);
+    triggerParamsDiscrete.thresholdParams(thresholds);
 
     auto [ec, path] = addTrigger(triggerParamsDiscrete);
     EXPECT_THAT(ec.value(), Eq(boost::system::errc::success));
@@ -203,10 +202,7 @@
         {"Name", TriggerParams().name()},
         {"ThresholdParamsDiscriminator",
          TriggerParams().thresholdParams().index()},
-        {"IsDiscrete", TriggerParams().isDiscrete()},
-        {"LogToJournal", TriggerParams().logToJournal()},
-        {"LogToRedfish", TriggerParams().logToRedfish()},
-        {"UpdateReport", TriggerParams().updateReport()},
+        {"TriggerActions", TriggerParams().triggerActions()},
         {"ThresholdParams", utils::labeledThresholdParamsToJson(
                                 TriggerParams().thresholdParams())},
         {"ReportNames", TriggerParams().reportNames()},