summaryrefslogtreecommitdiff
path: root/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc')
-rw-r--r--src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc
index aa55f54b6a..66cd740bbe 100644
--- a/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc
@@ -39,6 +39,7 @@
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
#include "application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h"
#include "interfaces/MOBILE_API.h"
#include "application_manager/smart_object_keys.h"
@@ -55,9 +56,11 @@ using ::testing::ReturnRef;
using ::testing::DoAll;
using ::testing::SaveArg;
using ::testing::InSequence;
+using ::testing::Mock;
namespace am = ::application_manager;
using am::commands::SubscribeWayPointsRequest;
using am::commands::MessageSharedPtr;
+using am::MockMessageHelper;
typedef SharedPtr<SubscribeWayPointsRequest> CommandPtr;
@@ -95,22 +98,31 @@ TEST_F(SubscribeWayPointsRequestTest, OnEvent_SUCCESS) {
Event event(hmi_apis::FunctionID::Navigation_SubscribeWayPoints);
MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::params][am::hmi_response::code] =
- mobile_apis::Result::SUCCESS;
+ const hmi_apis::Common_Result::eType result_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*event_msg)[am::strings::params][am::hmi_response::code] = result_code;
(*event_msg)[am::strings::msg_params] = 0;
event.set_smart_object(*event_msg);
+ MockMessageHelper* mock_message_helper =
+ MockMessageHelper::message_helper_mock();
+ Mock::VerifyAndClearExpectations(mock_message_helper);
+
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
{
InSequence dummy;
EXPECT_CALL(app_mngr_, SubscribeAppForWayPoints(_));
+ EXPECT_CALL(*mock_message_helper, HMIToMobileResult(result_code))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
EXPECT_CALL(*app, UpdateHash());
}
command->on_event(event);
+
+ Mock::VerifyAndClearExpectations(mock_message_helper);
}
} // namespace subscribe_way_points_request