diff options
author | Igor Gapchuk <igapchuck@luxoft.com> | 2020-03-16 12:28:52 +0200 |
---|---|---|
committer | Igor Gapchuk <igapchuck@luxoft.com> | 2020-03-16 12:28:52 +0200 |
commit | cb0aff2260fafc85d814a904ad7d03bc968f83c8 (patch) | |
tree | 16814f46a858e274b41786ab770780b432354f8b | |
parent | b16055a3e9369c6aaaef3ae241756f18e6958a4a (diff) | |
download | sdl_core-unit_tests/persisting_hmi_capabilities.tar.gz |
Add additional UT cases according to new functionallityunit_tests/persisting_hmi_capabilities
5 files changed, 730 insertions, 60 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc index e35ffa3102..deed2356ce 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc @@ -66,7 +66,7 @@ class RCIsReadyRequestTest void SetUpExpectations(bool is_rc_cooperating_available, bool is_send_message_to_hmi, - bool is_message_contain_param, + bool is_message_contains_param, am::HmiInterfaces::InterfaceState state) { if (is_send_message_to_hmi) { ExpectSendMessagesToHMI(); @@ -77,7 +77,7 @@ class RCIsReadyRequestTest EXPECT_CALL(mock_hmi_capabilities_, set_rc_supported(false)); } - if (is_message_contain_param) { + if (is_message_contains_param) { EXPECT_CALL(app_mngr_, hmi_interfaces()) .WillRepeatedly(ReturnRef(mock_hmi_interfaces_)); EXPECT_CALL( @@ -113,31 +113,44 @@ class RCIsReadyRequestTest event.set_smart_object(*msg); } - void HMICapabilitiesExpectations() { - std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ - hmi_apis::FunctionID::RC_GetCapabilities}; + void InterfacesUpdateExpectations( + const std::set<hmi_apis::FunctionID::eType>& interfaces_to_update) { EXPECT_CALL(mock_hmi_capabilities_, GetDefaultInitializedCapabilities()) - .WillOnce(Return(interfaces_to_update)); + .WillRepeatedly(Return(interfaces_to_update)); } RCIsReadyRequestPtr command_; }; -TEST_F(RCIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) { +MATCHER_P(HMIFunctionIDIs, function_id, "") { + const auto msg_function_id = static_cast<hmi_apis::FunctionID::eType>( + (*arg)[am::strings::params][am::strings::function_id].asInt()); + + return msg_function_id == function_id; +} + +TEST_F(RCIsReadyRequestTest, + OnEvent_NoKeyAvailableInMessage_HmiInterfacesIgnored_CacheIsAbsent) { const bool is_rc_cooperating_available = false; const bool is_send_message_to_hmi = true; const bool is_message_contain_param = false; Event event(hmi_apis::FunctionID::RC_IsReady); PrepareEvent(is_message_contain_param, event); - HMICapabilitiesExpectations(); + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::RC_GetCapabilities}; + InterfacesUpdateExpectations(interfaces_to_update); SetUpExpectations(is_rc_cooperating_available, is_send_message_to_hmi, is_message_contain_param, am::HmiInterfaces::STATE_NOT_RESPONSE); + + ASSERT_TRUE(command_->Init()); + command_->Run(); command_->on_event(event); } -TEST_F(RCIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) { +TEST_F(RCIsReadyRequestTest, + OnEvent_KeyAvailableEqualToFalse_StateNotAvailable_CacheIsAbsent) { const bool is_rc_cooperating_available = false; const bool is_send_message_to_hmi = false; const bool is_message_contain_param = true; @@ -147,29 +160,63 @@ TEST_F(RCIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) { is_send_message_to_hmi, is_message_contain_param, am::HmiInterfaces::STATE_NOT_AVAILABLE); + + ASSERT_TRUE(command_->Init()); + command_->Run(); command_->on_event(event); } -TEST_F(RCIsReadyRequestTest, Run_KeyAvailableEqualToTrue_StateAvailable) { +TEST_F(RCIsReadyRequestTest, + OnEvent_KeyAvailableEqualToTrue_StateAvailable_CacheIsAbsent) { const bool is_rc_cooperating_available = true; const bool is_send_message_to_hmi = true; const bool is_message_contain_param = true; Event event(hmi_apis::FunctionID::RC_IsReady); PrepareEvent(is_message_contain_param, event, is_rc_cooperating_available); - HMICapabilitiesExpectations(); + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::RC_GetCapabilities}; + InterfacesUpdateExpectations(interfaces_to_update); SetUpExpectations(is_rc_cooperating_available, is_send_message_to_hmi, is_message_contain_param, am::HmiInterfaces::STATE_AVAILABLE); + + ASSERT_TRUE(command_->Init()); + command_->Run(); command_->on_event(event); } -TEST_F(RCIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) { - HMICapabilitiesExpectations(); +TEST_F(RCIsReadyRequestTest, + OnEvent_HMIDoestRespond_SendMessageToHMIByTimeout_CacheIsAbsent) { + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::RC_GetCapabilities}; + InterfacesUpdateExpectations(interfaces_to_update); ExpectSendMessagesToHMI(); + + ASSERT_TRUE(command_->Init()); + command_->Run(); command_->onTimeOut(); } +TEST_F( + RCIsReadyRequestTest, + OnEvent_RCGetCapabilitiesExistInTheCache_DoesntSendRCGetCapabilitiesRequest) { + const bool is_message_contain_param = true; + Event event(hmi_apis::FunctionID::RC_IsReady); + PrepareEvent(is_message_contain_param, event); + std::set<hmi_apis::FunctionID::eType> interfaces_to_update; + InterfacesUpdateExpectations(interfaces_to_update); + + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::RC_GetCapabilities), _)) + .Times(0); + + ASSERT_TRUE(command_->Init()); + command_->Run(); + command_->on_event(event); +} + } // namespace rc_is_ready_request } // namespace hmi_commands_test } // namespace commands_test diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_request_test.cc new file mode 100644 index 0000000000..3005898ad4 --- /dev/null +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_request_test.cc @@ -0,0 +1,311 @@ +#include "hmi/tts_is_ready_request.h" + +#include <gmock/gmock.h> +#include <gtest/gtest.h> + +#include "application_manager/commands/command_request_test.h" +#include "application_manager/event_engine/event.h" +#include "application_manager/hmi_interfaces.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/mock_hmi_interface.h" +#include "application_manager/mock_message_helper.h" +#include "application_manager/smart_object_keys.h" +#include "smart_objects/smart_object.h" +#include "utils/helpers.h" + +namespace test { +namespace components { +namespace commands_test { +namespace hmi_commands_test { +namespace tts_is_ready_request { + +using ::testing::_; +using ::testing::ReturnRef; +namespace am = ::application_manager; +using am::commands::MessageSharedPtr; +using am::event_engine::Event; +using sdl_rpc_plugin::commands::TTSIsReadyRequest; + +typedef std::shared_ptr<TTSIsReadyRequest> TTSIsReadyRequestPtr; + +class TTSIsReadyRequestTest + : public CommandRequestTest<CommandsTestMocks::kIsNice> { + public: + TTSIsReadyRequestTest() : command_(CreateCommand<TTSIsReadyRequest>()) {} + + void SetUpExpectations(bool is_vr_cooperating_available, + bool is_send_message_to_hmi, + bool is_message_contains_param, + am::HmiInterfaces::InterfaceState state) { + if (is_send_message_to_hmi) { + ExpectSendMessagesToHMI(); + } + EXPECT_CALL(mock_hmi_capabilities_, + set_is_tts_cooperating(is_vr_cooperating_available)); + + if (is_message_contains_param) { + EXPECT_CALL(app_mngr_, hmi_interfaces()) + .WillRepeatedly(ReturnRef(mock_hmi_interfaces_)); + EXPECT_CALL( + mock_hmi_interfaces_, + SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS, state)); + } else { + EXPECT_CALL(app_mngr_, hmi_interfaces()) + .WillOnce(ReturnRef(mock_hmi_interfaces_)); + EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0); + } + EXPECT_CALL(mock_hmi_interfaces_, + GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS)) + .WillOnce(Return(state)); + } + + void ExpectSendMessagesToHMI() { + smart_objects::SmartObjectSPtr language( + std::make_shared<smart_objects::SmartObject>( + smart_objects::SmartType_Map)); + EXPECT_CALL(mock_message_helper_, + CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetLanguage, _)) + .WillOnce(Return(language)); + EXPECT_CALL(mock_hmi_capabilities_, set_handle_response_for(*language)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(language, _)); + + smart_objects::SmartObjectSPtr support_language( + std::make_shared<smart_objects::SmartObject>( + smart_objects::SmartType_Map)); + EXPECT_CALL( + mock_message_helper_, + CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetSupportedLanguages, _)) + .WillOnce(Return(support_language)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(support_language, _)); + + smart_objects::SmartObjectSPtr capabilities( + std::make_shared<smart_objects::SmartObject>( + smart_objects::SmartType_Map)); + EXPECT_CALL( + mock_message_helper_, + CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetCapabilities, _)) + .WillOnce(Return(capabilities)); + EXPECT_CALL(mock_rpc_service_, ManageHMICommand(capabilities, _)); + } + + void PrepareEvent(bool is_message_contain_param, + Event& event, + bool is_vr_cooperating_available = false) { + MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map); + if (is_message_contain_param) { + (*msg)[am::strings::msg_params][am::strings::available] = + is_vr_cooperating_available; + } + event.set_smart_object(*msg); + } + + void InterfacesUpdateExpectations( + const std::set<hmi_apis::FunctionID::eType>& interfaces_to_update) { + EXPECT_CALL(mock_hmi_capabilities_, GetDefaultInitializedCapabilities()) + .WillRepeatedly(Return(interfaces_to_update)); + } + + TTSIsReadyRequestPtr command_; +}; + +MATCHER_P(HMIFunctionIDIs, function_id, "") { + const auto msg_function_id = static_cast<hmi_apis::FunctionID::eType>( + (*arg)[am::strings::params][am::strings::function_id].asInt()); + + return msg_function_id == function_id; +} + +TEST_F(TTSIsReadyRequestTest, + OnEvent_NoKeyAvailableInMessage_HmiInterfacesIgnored_CacheIsAbsent) { + const bool is_tts_cooperating_available = false; + const bool is_send_message_to_hmi = true; + const bool is_message_contain_param = false; + Event event(hmi_apis::FunctionID::TTS_IsReady); + PrepareEvent(is_message_contain_param, event); + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::TTS_GetLanguage, + hmi_apis::FunctionID::TTS_GetSupportedLanguages, + hmi_apis::FunctionID::TTS_GetCapabilities}; + InterfacesUpdateExpectations(interfaces_to_update); + SetUpExpectations(is_tts_cooperating_available, + is_send_message_to_hmi, + is_message_contain_param, + am::HmiInterfaces::STATE_NOT_RESPONSE); + + ASSERT_TRUE(command_->Init()); + command_->Run(); + command_->on_event(event); +} + +TEST_F(TTSIsReadyRequestTest, + OnEven_KeyAvailableEqualToFalse_StateNotAvailable_CacheIsAbsent) { + const bool is_tts_cooperating_available = false; + const bool is_send_message_to_hmi = false; + const bool is_message_contain_param = true; + Event event(hmi_apis::FunctionID::TTS_IsReady); + PrepareEvent(is_message_contain_param, event); + SetUpExpectations(is_tts_cooperating_available, + is_send_message_to_hmi, + is_message_contain_param, + am::HmiInterfaces::STATE_NOT_AVAILABLE); + + ASSERT_TRUE(command_->Init()); + command_->Run(); + command_->on_event(event); +} + +TEST_F(TTSIsReadyRequestTest, + OnEven_KeyAvailableEqualToTrue_StateAvailable_CacheIsAbsnet) { + const bool is_tts_cooperating_available = true; + const bool is_send_message_to_hmi = true; + const bool is_message_contain_param = true; + Event event(hmi_apis::FunctionID::TTS_IsReady); + PrepareEvent(is_message_contain_param, event, is_tts_cooperating_available); + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::TTS_GetLanguage, + hmi_apis::FunctionID::TTS_GetSupportedLanguages, + hmi_apis::FunctionID::TTS_GetCapabilities}; + InterfacesUpdateExpectations(interfaces_to_update); + SetUpExpectations(is_tts_cooperating_available, + is_send_message_to_hmi, + is_message_contain_param, + am::HmiInterfaces::STATE_AVAILABLE); + + ASSERT_TRUE(command_->Init()); + command_->Run(); + command_->on_event(event); +} + +TEST_F(TTSIsReadyRequestTest, + OnEven_HMIDoestRespond_SendMessageToHMIByTimeout_CacheIsAbsent) { + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::TTS_GetLanguage, + hmi_apis::FunctionID::TTS_GetSupportedLanguages, + hmi_apis::FunctionID::TTS_GetCapabilities}; + InterfacesUpdateExpectations(interfaces_to_update); + ExpectSendMessagesToHMI(); + + ASSERT_TRUE(command_->Init()); + command_->Run(); + command_->onTimeOut(); +} + +TEST_F(TTSIsReadyRequestTest, + OnEvent_TTSLanguageIsAbsentInCache_SendTTSGetLanguageRequest) { + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::TTS_GetLanguage}; + + Event event(hmi_apis::FunctionID::TTS_IsReady); + + InterfacesUpdateExpectations(interfaces_to_update); + + smart_objects::SmartObjectSPtr language( + std::make_shared<smart_objects::SmartObject>( + smart_objects::SmartType_Map)); + (*language)[am::strings::params][am::strings::function_id] = + hmi_apis::FunctionID::TTS_GetLanguage; + EXPECT_CALL(mock_message_helper_, + CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetLanguage, _)) + .WillOnce(Return(language)); + EXPECT_CALL(mock_hmi_capabilities_, set_handle_response_for(*language)); + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::TTS_GetLanguage), _)); + + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::TTS_GetSupportedLanguages), _)) + .Times(0); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::TTS_GetCapabilities), _)) + .Times(0); + + ASSERT_TRUE(command_->Init()); + command_->Run(); + command_->on_event(event); +} + +TEST_F( + TTSIsReadyRequestTest, + OnEvent_TTSGetSupportedLanguagesIsAbsentInCache_SendTTSGetSupportedLanguagesRequest) { + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::TTS_GetSupportedLanguages}; + + Event event(hmi_apis::FunctionID::TTS_IsReady); + + InterfacesUpdateExpectations(interfaces_to_update); + smart_objects::SmartObjectSPtr all_languages( + std::make_shared<smart_objects::SmartObject>( + smart_objects::SmartType_Map)); + (*all_languages)[am::strings::params][am::strings::function_id] = + hmi_apis::FunctionID::TTS_GetSupportedLanguages; + EXPECT_CALL( + mock_message_helper_, + CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetSupportedLanguages, _)) + .WillOnce(Return(all_languages)); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::TTS_GetSupportedLanguages), _)); + + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::TTS_GetLanguage), _)) + .Times(0); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::TTS_GetCapabilities), _)) + .Times(0); + + ASSERT_TRUE(command_->Init()); + command_->Run(); + command_->on_event(event); +} + +TEST_F( + TTSIsReadyRequestTest, + OnEvent_TTSGetCapabilitiesIsAbsentInCache_SendTTSGetCapabilitiesRequest) { + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::TTS_GetCapabilities}; + + Event event(hmi_apis::FunctionID::TTS_IsReady); + + InterfacesUpdateExpectations(interfaces_to_update); + smart_objects::SmartObjectSPtr capabilities( + std::make_shared<smart_objects::SmartObject>( + smart_objects::SmartType_Map)); + (*capabilities)[am::strings::params][am::strings::function_id] = + hmi_apis::FunctionID::TTS_GetCapabilities; + EXPECT_CALL(mock_message_helper_, + CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetCapabilities, _)) + .WillOnce(Return(capabilities)); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::TTS_GetCapabilities), _)); + + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::TTS_GetLanguage), _)) + .Times(0); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::TTS_GetSupportedLanguages), _)) + .Times(0); + + ASSERT_TRUE(command_->Init()); + command_->Run(); + command_->on_event(event); +} + +} // namespace tts_is_ready_request +} // namespace hmi_commands_test +} // namespace commands_test +} // namespace components +} // namespace test diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc index b83c45ccca..271d787cf6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc @@ -69,12 +69,12 @@ class UIIsReadyRequestTest void SetUpExpectations(bool is_ui_cooperating_available, bool is_send_message_to_hmi, - bool is_message_contain_param, + bool is_message_contains_param, am::HmiInterfaces::InterfaceState state) { EXPECT_CALL(mock_hmi_capabilities_, set_is_ui_cooperating(is_ui_cooperating_available)); - if (is_message_contain_param) { + if (is_message_contains_param) { EXPECT_CALL(app_mngr_, hmi_interfaces()) .WillRepeatedly(ReturnRef(mock_hmi_interfaces_)); EXPECT_CALL( @@ -141,11 +141,8 @@ class UIIsReadyRequestTest event.set_smart_object(*msg); } - void HMICapabilitiesExpectations() { - std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ - hmi_apis::FunctionID::UI_GetLanguage, - hmi_apis::FunctionID::UI_GetSupportedLanguages, - hmi_apis::FunctionID::UI_GetCapabilities}; + void InterfacesUpdateExpectations( + const std::set<hmi_apis::FunctionID::eType>& interfaces_to_update) { EXPECT_CALL(mock_hmi_capabilities_, GetDefaultInitializedCapabilities()) .WillOnce(Return(interfaces_to_update)); } @@ -154,6 +151,13 @@ class UIIsReadyRequestTest policy_test::MockPolicyHandlerInterface mock_policy_handler_interface_; }; +MATCHER_P(HMIFunctionIDIs, function_id, "") { + const auto msg_function_id = static_cast<hmi_apis::FunctionID::eType>( + (*arg)[am::strings::params][am::strings::function_id].asInt()); + + return msg_function_id == function_id; +} + TEST_F(UIIsReadyRequestTest, OnEvent_NoKeyAvailableInMessage_HmiInterfacesIgnored_CacheIsAbsent) { const bool is_ui_cooperating_available = false; @@ -161,12 +165,18 @@ TEST_F(UIIsReadyRequestTest, const bool is_message_contain_param = false; Event event(hmi_apis::FunctionID::UI_IsReady); PrepareEvent(is_message_contain_param, event); - HMICapabilitiesExpectations(); + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::UI_GetLanguage, + hmi_apis::FunctionID::UI_GetSupportedLanguages, + hmi_apis::FunctionID::UI_GetCapabilities}; + InterfacesUpdateExpectations(interfaces_to_update); SetUpExpectations(is_ui_cooperating_available, is_send_message_to_hmi, is_message_contain_param, am::HmiInterfaces::STATE_NOT_RESPONSE); + ASSERT_TRUE(command_->Init()); + command_->Run(); command_->on_event(event); } @@ -181,6 +191,9 @@ TEST_F(UIIsReadyRequestTest, is_send_message_to_hmi, is_message_contain_param, am::HmiInterfaces::STATE_NOT_AVAILABLE); + + ASSERT_TRUE(command_->Init()); + command_->Run(); command_->on_event(event); } @@ -191,11 +204,18 @@ TEST_F(UIIsReadyRequestTest, const bool is_message_contain_param = true; Event event(hmi_apis::FunctionID::UI_IsReady); PrepareEvent(is_message_contain_param, event, is_ui_cooperating_available); - HMICapabilitiesExpectations(); + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::UI_GetLanguage, + hmi_apis::FunctionID::UI_GetSupportedLanguages, + hmi_apis::FunctionID::UI_GetCapabilities}; + InterfacesUpdateExpectations(interfaces_to_update); SetUpExpectations(is_ui_cooperating_available, is_send_message_to_hmi, is_message_contain_param, am::HmiInterfaces::STATE_AVAILABLE); + + ASSERT_TRUE(command_->Init()); + command_->Run(); command_->on_event(event); } @@ -204,12 +224,127 @@ TEST_F(UIIsReadyRequestTest, OnTimeout_SUCCESS_CacheIsAbsent) { hmi_apis::FunctionID::UI_GetLanguage, hmi_apis::FunctionID::UI_GetSupportedLanguages, hmi_apis::FunctionID::UI_GetCapabilities}; - EXPECT_CALL(mock_hmi_capabilities_, GetDefaultInitializedCapabilities()) - .WillOnce(Return(interfaces_to_update)); + InterfacesUpdateExpectations(interfaces_to_update); ExpectSendMessagesToHMI(); + + ASSERT_TRUE(command_->Init()); + command_->Run(); command_->onTimeOut(); } +TEST_F(UIIsReadyRequestTest, + OnEvent_UIGetLanguageIsAbsentInCache_SendOnlyUIGetLanguageRequest) { + Event event(hmi_apis::FunctionID::UI_IsReady); + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::UI_GetLanguage}; + + InterfacesUpdateExpectations(interfaces_to_update); + + smart_objects::SmartObjectSPtr language( + std::make_shared<smart_objects::SmartObject>( + smart_objects::SmartType_Map)); + (*language)[am::strings::params][am::strings::function_id] = + hmi_apis::FunctionID::UI_GetLanguage; + + EXPECT_CALL(mock_message_helper_, + CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetLanguage, _)) + .WillOnce(Return(language)); + EXPECT_CALL(mock_hmi_capabilities_, set_handle_response_for(*language)); + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::UI_GetLanguage), _)); + + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::UI_GetSupportedLanguages), _)) + .Times(0); + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::UI_GetCapabilities), _)) + .Times(0); + + ASSERT_TRUE(command_->Init()); + command_->Run(); + command_->on_event(event); +} + +TEST_F( + UIIsReadyRequestTest, + OnEvent_UIGetSupportedLanguagesIsAbsentInCache_SendOnlyUIGetSupportedLanguagesRequest) { + Event event(hmi_apis::FunctionID::UI_IsReady); + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::UI_GetSupportedLanguages}; + + InterfacesUpdateExpectations(interfaces_to_update); + + smart_objects::SmartObjectSPtr all_languages( + std::make_shared<smart_objects::SmartObject>( + smart_objects::SmartType_Map)); + (*all_languages)[am::strings::params][am::strings::function_id] = + hmi_apis::FunctionID::UI_GetSupportedLanguages; + + EXPECT_CALL( + mock_message_helper_, + CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetSupportedLanguages, _)) + .WillOnce(Return(all_languages)); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::UI_GetSupportedLanguages), _)); + + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::UI_GetLanguage), _)) + .Times(0); + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::UI_GetCapabilities), _)) + .Times(0); + + ASSERT_TRUE(command_->Init()); + command_->Run(); + command_->on_event(event); +} + +TEST_F( + UIIsReadyRequestTest, + OnEvent_UIGetCapabilitiesIsAbsentInCache_SendOnlyUIGetCapabilitiesRequest) { + Event event(hmi_apis::FunctionID::UI_IsReady); + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::UI_GetCapabilities}; + + InterfacesUpdateExpectations(interfaces_to_update); + + smart_objects::SmartObjectSPtr all_languages( + std::make_shared<smart_objects::SmartObject>( + smart_objects::SmartType_Map)); + (*all_languages)[am::strings::params][am::strings::function_id] = + hmi_apis::FunctionID::UI_GetCapabilities; + + EXPECT_CALL(mock_message_helper_, + CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetCapabilities, _)) + .WillOnce(Return(all_languages)); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::UI_GetCapabilities), _)); + + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::UI_GetLanguage), _)) + .Times(0); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::UI_GetSupportedLanguages), _)) + .Times(0); + + ASSERT_TRUE(command_->Init()); + command_->Run(); + command_->on_event(event); +} + } // namespace ui_is_ready_request } // namespace hmi_commands_test } // namespace commands_test diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc index db9611bb40..b5d5f626f8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc @@ -43,6 +43,7 @@ #include "application_manager/mock_message_helper.h" #include "application_manager/smart_object_keys.h" #include "smart_objects/smart_object.h" +#include "utils/helpers.h" namespace test { namespace components { @@ -66,16 +67,15 @@ class VRIsReadyRequestTest void SetUpExpectations(bool is_vr_cooperating_available, bool is_send_message_to_hmi, - bool is_message_contain_param, + bool is_message_contains_param, am::HmiInterfaces::InterfaceState state) { - const bool is_send_message_by_timeout = false; if (is_send_message_to_hmi) { - ExpectSendMessagesToHMI(is_send_message_by_timeout); + ExpectSendMessagesToHMI(); } EXPECT_CALL(mock_hmi_capabilities_, set_is_vr_cooperating(is_vr_cooperating_available)); - if (is_message_contain_param) { + if (is_message_contains_param) { EXPECT_CALL(app_mngr_, hmi_interfaces()) .WillRepeatedly(ReturnRef(mock_hmi_interfaces_)); EXPECT_CALL( @@ -91,9 +91,10 @@ class VRIsReadyRequestTest .WillOnce(Return(state)); } - void ExpectSendMessagesToHMI(bool is_send_message_by_timeout) { + void ExpectSendMessagesToHMI() { smart_objects::SmartObjectSPtr language( - new smart_objects::SmartObject(smart_objects::SmartType_Map)); + std::make_shared<smart_objects::SmartObject>( + smart_objects::SmartType_Map)); EXPECT_CALL(mock_message_helper_, CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage, _)) .WillOnce(Return(language)); @@ -101,7 +102,8 @@ class VRIsReadyRequestTest EXPECT_CALL(mock_rpc_service_, ManageHMICommand(language, _)); smart_objects::SmartObjectSPtr support_language( - new smart_objects::SmartObject(smart_objects::SmartType_Map)); + std::make_shared<smart_objects::SmartObject>( + smart_objects::SmartType_Map)); EXPECT_CALL( mock_message_helper_, CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetSupportedLanguages, _)) @@ -109,7 +111,8 @@ class VRIsReadyRequestTest EXPECT_CALL(mock_rpc_service_, ManageHMICommand(support_language, _)); smart_objects::SmartObjectSPtr capabilities( - new smart_objects::SmartObject(smart_objects::SmartType_Map)); + std::make_shared<smart_objects::SmartObject>( + smart_objects::SmartType_Map)); EXPECT_CALL(mock_message_helper_, CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetCapabilities, _)) .WillOnce(Return(capabilities)); @@ -127,11 +130,8 @@ class VRIsReadyRequestTest event.set_smart_object(*msg); } - void HMICapabilitiesExpectations() { - std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ - hmi_apis::FunctionID::VR_GetLanguage, - hmi_apis::FunctionID::VR_GetSupportedLanguages, - hmi_apis::FunctionID::VR_GetCapabilities}; + void InterfacesUpdateExpectations( + const std::set<hmi_apis::FunctionID::eType>& interfaces_to_update) { EXPECT_CALL(mock_hmi_capabilities_, GetDefaultInitializedCapabilities()) .WillOnce(Return(interfaces_to_update)); } @@ -139,23 +139,37 @@ class VRIsReadyRequestTest VRIsReadyRequestPtr command_; }; +MATCHER_P(HMIFunctionIDIs, function_id, "") { + const auto msg_function_id = static_cast<hmi_apis::FunctionID::eType>( + (*arg)[am::strings::params][am::strings::function_id].asInt()); + + return msg_function_id == function_id; +} + TEST_F(VRIsReadyRequestTest, - Run_NoKeyAvailableInMessage_HmiInterfacesIgnored_CacheIsAbsent) { + OnEvent_NoKeyAvailableInMessage_HmiInterfacesIgnored_CacheIsAbsent) { const bool is_vr_cooperating_available = false; const bool is_send_message_to_hmi = true; const bool is_message_contain_param = false; Event event(hmi_apis::FunctionID::VR_IsReady); PrepareEvent(is_message_contain_param, event); - HMICapabilitiesExpectations(); + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::VR_GetLanguage, + hmi_apis::FunctionID::VR_GetSupportedLanguages, + hmi_apis::FunctionID::VR_GetCapabilities}; + InterfacesUpdateExpectations(interfaces_to_update); SetUpExpectations(is_vr_cooperating_available, is_send_message_to_hmi, is_message_contain_param, am::HmiInterfaces::STATE_NOT_RESPONSE); + + ASSERT_TRUE(command_->Init()); + command_->Run(); command_->on_event(event); } TEST_F(VRIsReadyRequestTest, - Run_KeyAvailableEqualToFalse_StateNotAvailable_CacheIsAbsent) { + OnEvent_KeyAvailableEqualToFalse_StateNotAvailable_CacheIsAbsent) { const bool is_vr_cooperating_available = false; const bool is_send_message_to_hmi = false; const bool is_message_contain_param = true; @@ -165,21 +179,31 @@ TEST_F(VRIsReadyRequestTest, is_send_message_to_hmi, is_message_contain_param, am::HmiInterfaces::STATE_NOT_AVAILABLE); + + ASSERT_TRUE(command_->Init()); + command_->Run(); command_->on_event(event); } TEST_F(VRIsReadyRequestTest, - Run_KeyAvailableEqualToTrue_StateAvailable_CacheIsAbsnet) { + OnEvent_KeyAvailableEqualToTrue_StateAvailable_CacheIsAbsnet) { const bool is_vr_cooperating_available = true; const bool is_send_message_to_hmi = true; const bool is_message_contain_param = true; Event event(hmi_apis::FunctionID::VR_IsReady); PrepareEvent(is_message_contain_param, event, is_vr_cooperating_available); - HMICapabilitiesExpectations(); + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::VR_GetLanguage, + hmi_apis::FunctionID::VR_GetSupportedLanguages, + hmi_apis::FunctionID::VR_GetCapabilities}; + InterfacesUpdateExpectations(interfaces_to_update); SetUpExpectations(is_vr_cooperating_available, is_send_message_to_hmi, is_message_contain_param, am::HmiInterfaces::STATE_AVAILABLE); + + ASSERT_TRUE(command_->Init()); + command_->Run(); command_->on_event(event); } @@ -189,13 +213,124 @@ TEST_F(VRIsReadyRequestTest, hmi_apis::FunctionID::VR_GetLanguage, hmi_apis::FunctionID::VR_GetSupportedLanguages, hmi_apis::FunctionID::VR_GetCapabilities}; - EXPECT_CALL(mock_hmi_capabilities_, GetDefaultInitializedCapabilities()) - .WillOnce(Return(interfaces_to_update)); - const bool is_send_message_by_timeout = true; - ExpectSendMessagesToHMI(is_send_message_by_timeout); + InterfacesUpdateExpectations(interfaces_to_update); + ExpectSendMessagesToHMI(); + + ASSERT_TRUE(command_->Init()); + command_->Run(); command_->onTimeOut(); } +TEST_F(VRIsReadyRequestTest, + OnEvent_VRLanguageIsAbsentInCache_SendVRGetLanguageRequest) { + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::VR_GetLanguage}; + + Event event(hmi_apis::FunctionID::VR_IsReady); + + InterfacesUpdateExpectations(interfaces_to_update); + + smart_objects::SmartObjectSPtr language( + std::make_shared<smart_objects::SmartObject>( + smart_objects::SmartType_Map)); + (*language)[am::strings::params][am::strings::function_id] = + hmi_apis::FunctionID::VR_GetLanguage; + EXPECT_CALL(mock_message_helper_, + CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage, _)) + .WillOnce(Return(language)); + EXPECT_CALL(mock_hmi_capabilities_, set_handle_response_for(*language)); + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::VR_GetLanguage), _)); + + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::VR_GetSupportedLanguages), _)) + .Times(0); + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::VR_GetCapabilities), _)) + .Times(0); + + ASSERT_TRUE(command_->Init()); + command_->Run(); + command_->on_event(event); +} + +TEST_F( + VRIsReadyRequestTest, + OnEvent_VRGetSupportedLanguagesIsAbsentInCache_SendVRGetSupportedLanguagesRequest) { + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::VR_GetSupportedLanguages}; + + Event event(hmi_apis::FunctionID::VR_IsReady); + + InterfacesUpdateExpectations(interfaces_to_update); + smart_objects::SmartObjectSPtr all_languages( + std::make_shared<smart_objects::SmartObject>( + smart_objects::SmartType_Map)); + (*all_languages)[am::strings::params][am::strings::function_id] = + hmi_apis::FunctionID::VR_GetSupportedLanguages; + EXPECT_CALL( + mock_message_helper_, + CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetSupportedLanguages, _)) + .WillOnce(Return(all_languages)); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::VR_GetSupportedLanguages), _)); + + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::VR_GetLanguage), _)) + .Times(0); + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::VR_GetCapabilities), _)) + .Times(0); + + ASSERT_TRUE(command_->Init()); + command_->Run(); + command_->on_event(event); +} + +TEST_F(VRIsReadyRequestTest, + OnEvent_VRGetCapabilitiesIsAbsentInCache_SendVRGetCapabilitiesRequest) { + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::VR_GetCapabilities}; + + Event event(hmi_apis::FunctionID::VR_IsReady); + + InterfacesUpdateExpectations(interfaces_to_update); + smart_objects::SmartObjectSPtr capabilities( + std::make_shared<smart_objects::SmartObject>( + smart_objects::SmartType_Map)); + (*capabilities)[am::strings::params][am::strings::function_id] = + hmi_apis::FunctionID::VR_GetCapabilities; + EXPECT_CALL(mock_message_helper_, + CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetCapabilities, _)) + .WillOnce(Return(capabilities)); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::VR_GetCapabilities), _)); + + EXPECT_CALL(mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::VR_GetLanguage), _)) + .Times(0); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::VR_GetSupportedLanguages), _)) + .Times(0); + + ASSERT_TRUE(command_->Init()); + command_->Run(); + command_->on_event(event); +} + } // namespace vr_is_ready_request } // namespace hmi_commands_test } // namespace commands_test diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc index f64e20a49e..58735f84fa 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc @@ -70,12 +70,12 @@ class VIIsReadyRequestTest void SetUpExpectations(bool is_vi_cooperating_available, bool is_send_message_to_hmi, - bool is_message_contain_param, + bool is_message_contains_param, am::HmiInterfaces::InterfaceState state) { EXPECT_CALL(mock_hmi_capabilities_, set_is_ivi_cooperating(is_vi_cooperating_available)); - if (is_message_contain_param) { + if (is_message_contains_param) { EXPECT_CALL(app_mngr_, hmi_interfaces()) .WillRepeatedly(ReturnRef(mock_hmi_interfaces_)); EXPECT_CALL(mock_hmi_interfaces_, @@ -117,10 +117,8 @@ class VIIsReadyRequestTest event.set_smart_object(*msg); } - void HMICapabilitiesExpectations() { - std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ - hmi_apis::FunctionID::VehicleInfo_GetVehicleType}; - + void InterfacesUpdateExpectations( + const std::set<hmi_apis::FunctionID::eType>& interfaces_to_update) { EXPECT_CALL(mock_hmi_capabilities_, GetDefaultInitializedCapabilities()) .WillOnce(Return(interfaces_to_update)); } @@ -128,21 +126,35 @@ class VIIsReadyRequestTest VIIsReadyRequestPtr command_; }; -TEST_F(VIIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) { +MATCHER_P(HMIFunctionIDIs, function_id, "") { + const auto msg_function_id = static_cast<hmi_apis::FunctionID::eType>( + (*arg)[am::strings::params][am::strings::function_id].asInt()); + + return msg_function_id == function_id; +} + +TEST_F(VIIsReadyRequestTest, + OnEvent_NoKeyAvailableInMessage_HmiInterfacesIgnored_CacheIsAbsent) { const bool is_vi_cooperating_available = false; const bool is_send_message_to_hmi = true; const bool is_message_contain_param = false; Event event(hmi_apis::FunctionID::VehicleInfo_IsReady); PrepareEvent(is_message_contain_param, event); - HMICapabilitiesExpectations(); + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::VehicleInfo_GetVehicleType}; + InterfacesUpdateExpectations(interfaces_to_update); SetUpExpectations(is_vi_cooperating_available, is_send_message_to_hmi, is_message_contain_param, am::HmiInterfaces::STATE_NOT_RESPONSE); + + ASSERT_TRUE(command_->Init()); + command_->Run(); command_->on_event(event); } -TEST_F(VIIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) { +TEST_F(VIIsReadyRequestTest, + OnEvent_KeyAvailableEqualToFalse_StateNotAvailable_CacheIsAbsent) { const bool is_vi_cooperating_available = false; const bool is_send_message_to_hmi = false; const bool is_message_contain_param = true; @@ -152,32 +164,62 @@ TEST_F(VIIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) { is_send_message_to_hmi, is_message_contain_param, am::HmiInterfaces::STATE_NOT_AVAILABLE); + + ASSERT_TRUE(command_->Init()); + command_->Run(); command_->on_event(event); } -TEST_F(VIIsReadyRequestTest, Run_KeyAvailableEqualToTrue_StateAvailable) { +TEST_F(VIIsReadyRequestTest, + OnEvent_KeyAvailableEqualToTrue_StateAvailable_CacheIsAbsent) { const bool is_vi_cooperating_available = true; const bool is_send_message_to_hmi = true; const bool is_message_contain_param = true; Event event(hmi_apis::FunctionID::VehicleInfo_IsReady); - HMICapabilitiesExpectations(); + std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ + hmi_apis::FunctionID::VehicleInfo_GetVehicleType}; + InterfacesUpdateExpectations(interfaces_to_update); PrepareEvent(is_message_contain_param, event, is_vi_cooperating_available); SetUpExpectations(is_vi_cooperating_available, is_send_message_to_hmi, is_message_contain_param, am::HmiInterfaces::STATE_AVAILABLE); + + ASSERT_TRUE(command_->Init()); + command_->Run(); command_->on_event(event); } -TEST_F(VIIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) { +TEST_F(VIIsReadyRequestTest, + OnEvent_HMIDoestRespond_SendMessageToHMIByTimeout_CacheIsAbsent) { std::set<hmi_apis::FunctionID::eType> interfaces_to_update{ hmi_apis::FunctionID::VehicleInfo_GetVehicleType}; - EXPECT_CALL(mock_hmi_capabilities_, GetDefaultInitializedCapabilities()) - .WillOnce(Return(interfaces_to_update)); + InterfacesUpdateExpectations(interfaces_to_update); ExpectSendMessagesToHMI(); + + ASSERT_TRUE(command_->Init()); + command_->Run(); command_->onTimeOut(); } +TEST_F(VIIsReadyRequestTest, + OnEvent_VehicleInfoExistInTheCache_DoesntSendVIGetVehicleTypeRequest) { + const bool is_message_contain_param = false; + Event event(hmi_apis::FunctionID::VehicleInfo_IsReady); + PrepareEvent(is_message_contain_param, event); + std::set<hmi_apis::FunctionID::eType> interfaces_to_update; + InterfacesUpdateExpectations(interfaces_to_update); + EXPECT_CALL( + mock_rpc_service_, + ManageHMICommand( + HMIFunctionIDIs(hmi_apis::FunctionID::VehicleInfo_GetVehicleType), _)) + .Times(0); + + ASSERT_TRUE(command_->Init()); + command_->Run(); + command_->on_event(event); +} + } // namespace vi_is_ready_request } // namespace hmi_commands_test } // namespace commands_test |