~aleteoryx/muditaos

63ed68ac4fc60d34f8aa3b935ab2946c9c0101b8 — Roman Kubiak 4 years ago ed290b3
[EGD-5970] Fix update unit tests

Unit test fixes for update process
M module-services/service-desktop/endpoints/update/UpdateMuditaOS.cpp => module-services/service-desktop/endpoints/update/UpdateMuditaOS.cpp +3 -1
@@ 864,13 864,15 @@ void UpdateMuditaOS::setInitialHistory(const std::string &initialHistory)
        updateHistory = json11::Json();
    }
}

void UpdateMuditaOS::informUpdateWindow()
{
    fs::path file  = UpdateMuditaOS::checkForUpdate();
    auto msgToSend = std::make_shared<sdesktop::UpdateOsMessage>(updateos::UpdateMessageType::UpdateNow, file);
    msgToSend->updateStats.versionInformation = UpdateMuditaOS::getVersionInfoFromFile(file);
    msgToSend->updateStats.status             = status;
    owner->bus.sendUnicast(msgToSend, app::name_desktop);
    if (owner)
        owner->bus.sendUnicast(msgToSend, app::name_desktop);
}

void UpdateMuditaOS::storeRunStatusInDB()

M module-services/service-desktop/tests/unittest.cpp => module-services/service-desktop/tests/unittest.cpp +2 -2
@@ 247,11 247,11 @@ TEST_CASE("Context class test")
        REQUIRE(context.getUuid() == 12345);
        REQUIRE(context.getEndpoint() == EndpointType::contacts);
        REQUIRE(context.createSimpleResponse() ==
                R"(#000000061{"body": null, "endpoint": 7, "status": 200, "uuid": 12345})");
                R"(#000000059{"body": null, "endpoint": 7, "status": 200, "uuid": 12345})");

        context.setResponseBody(context.getBody());
        REQUIRE(context.createSimpleResponse() ==
                R"(#000000073{"body": {"test": "test"}, "endpoint": 7, "status": 200, "uuid": 12345})");
                R"(#000000071{"body": {"test": "test"}, "endpoint": 7, "status": 200, "uuid": 12345})");
    }
    SECTION("Invalid message")
    {