diff --git a/tests/src/mocks/metric_mock.hpp b/tests/src/mocks/metric_mock.hpp
index 6dfe660..dc0309b 100644
--- a/tests/src/mocks/metric_mock.hpp
+++ b/tests/src/mocks/metric_mock.hpp
@@ -13,7 +13,7 @@
 
         ON_CALL(*this, getUpdatedReadings())
             .WillByDefault(ReturnRefOfCopy(std::vector<MetricValue>()));
-        ON_CALL(*this, sensorCount).WillByDefault(InvokeWithoutArgs([this] {
+        ON_CALL(*this, metricCount).WillByDefault(InvokeWithoutArgs([this] {
             return getUpdatedReadings().size();
         }));
     }
@@ -24,7 +24,7 @@
                 (override));
     MOCK_METHOD(LabeledMetricParameters, dumpConfiguration, (),
                 (const, override));
-    MOCK_METHOD(uint64_t, sensorCount, (), (const, override));
+    MOCK_METHOD(uint64_t, metricCount, (), (const, override));
     MOCK_METHOD(void, registerForUpdates, (interfaces::MetricListener&),
                 (override));
     MOCK_METHOD(void, unregisterFromUpdates, (interfaces::MetricListener&),
diff --git a/tests/src/test_report.cpp b/tests/src/test_report.cpp
index ea3b4f8..875bd4b 100644
--- a/tests/src/test_report.cpp
+++ b/tests/src/test_report.cpp
@@ -109,7 +109,7 @@
             metricMocks.emplace_back(std::make_shared<NiceMock<MetricMock>>());
             ON_CALL(*metricMocks[i], dumpConfiguration())
                 .WillByDefault(Return(metricParameters[i]));
-            ON_CALL(*metricMocks[i], sensorCount())
+            ON_CALL(*metricMocks[i], metricCount())
                 .WillByDefault(Return(metricParameters[i]
                                           .at_label<tstring::SensorPath>()
                                           .size()));
@@ -285,34 +285,6 @@
                 Eq(newParams));
 }
 
-TEST_F(TestReport, setReadingParametersWithNewParamsUpdatesSensorCount)
-{
-    auto report =
-        makeReport(ReportParams()
-                       .appendLimit(std::numeric_limits<uint64_t>::max())
-                       .reportId("DefaultAppendLimit"));
-
-    ReadingParameters newParams = toReadingParameters(
-        std::vector<LabeledMetricParameters>{{LabeledMetricParameters{
-            {LabeledSensorInfo{"Service",
-                               "/xyz/openbmc_project/sensors/power/psu",
-                               "NewMetadata123"}},
-            OperationType::avg,
-            "NewMetricId123",
-            CollectionTimeScope::startup,
-            CollectionDuration(250ms)}}});
-    auto metrics = getMetricsFromReadingParams(newParams);
-
-    EXPECT_CALL(*reportFactoryMock, updateMetrics(_, _, _))
-        .WillOnce(SetArgReferee<0>(metrics));
-    EXPECT_THAT(setProperty(report->getPath(), "ReadingParametersFutureVersion",
-                            newParams)
-                    .value(),
-                Eq(boost::system::errc::success));
-    EXPECT_THAT(getProperty<uint64_t>(report->getPath(), "AppendLimit"),
-                Eq(1ull));
-}
-
 TEST_F(TestReport, setReadingParametersWithTooLongMetricId)
 {
     const ReadingParameters currentValue =
@@ -707,7 +679,7 @@
     _, TestReportStore,
     Values(
         std::make_pair("Enabled"s, nlohmann::json(defaultParams().enabled())),
-        std::make_pair("Version"s, nlohmann::json(6)),
+        std::make_pair("Version"s, nlohmann::json(7)),
         std::make_pair("Id"s, nlohmann::json(defaultParams().reportId())),
         std::make_pair("Name"s, nlohmann::json(defaultParams().reportName())),
         std::make_pair("ReportingType",
@@ -965,6 +937,7 @@
     void SetUp() override
     {
         sut = makeReport(defaultParams()
+                             .appendLimit(2u)
                              .reportingType(ReportingType::periodic)
                              .interval(ReportManager::minInterval));
     }
@@ -1125,7 +1098,7 @@
         ReportUpdatesReportParams{
             defaultParams()
                 .reportUpdates(ReportUpdates::appendStopsWhenFull)
-                .appendLimit(std::numeric_limits<uint64_t>::max()),
+                .appendLimit(2u),
             std::vector<ReadingData>{
                 {std::make_tuple("a"s, "b"s, 17.1, 114u),
                  std::make_tuple("aa"s, "bb"s, 42.0, 74u)}},
@@ -1149,6 +1122,7 @@
        appendLimitIsRespectedAfterChangingToPeriodic)
 {
     sut = makeReport(ReportParams(GetParam().reportParams)
+                         .appendLimit(GetParam().expectedReadings.size())
                          .reportingType(ReportingType::onRequest)
                          .interval(std::chrono::hours(0)));
 
@@ -1305,23 +1279,6 @@
     DbusEnvironment::sleepFor(defaultParams().interval() * 2);
 }
 
-TEST_F(TestReportInitialization, appendLimitDeducedProperly)
-{
-    sut = makeReport(
-        defaultParams().appendLimit(std::numeric_limits<uint64_t>::max()));
-    auto appendLimit = getProperty<uint64_t>(sut->getPath(), "AppendLimit");
-    EXPECT_EQ(appendLimit, 2ull);
-}
-
-TEST_F(TestReportInitialization, appendLimitSetToUintMaxIsStoredCorrectly)
-{
-    sut = makeReport(
-        ReportParams().appendLimit(std::numeric_limits<uint64_t>::max()));
-
-    ASSERT_THAT(storedConfiguration.at("AppendLimit"),
-                Eq(std::numeric_limits<uint64_t>::max()));
-}
-
 TEST_F(TestReportInitialization, triggerIdsPropertyIsInitialzed)
 {
     for (const auto& triggerId : {"trigger1", "trigger2"})
