summaryrefslogtreecommitdiff
path: root/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc')
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc
index 415b559f82..8db533f446 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc
@@ -36,18 +36,18 @@
#include "gtest/gtest.h"
-#include "application_manager/commands/commands_test.h"
#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/commands_test.h"
-#include "mobile/put_file_response.h"
#include "mobile/put_file_request.h"
+#include "mobile/put_file_response.h"
-#include "utils/file_system.h"
-#include "smart_objects/smart_object.h"
-#include "interfaces/MOBILE_API.h"
#include "application_manager/application.h"
#include "application_manager/mock_application.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "interfaces/MOBILE_API.h"
+#include "smart_objects/smart_object.h"
+#include "utils/file_system.h"
namespace test {
namespace components {
@@ -56,16 +56,16 @@ namespace mobile_commands_test {
namespace put_file {
using ::testing::_;
+using ::testing::AtLeast;
using ::testing::Return;
using ::testing::ReturnRef;
-using ::testing::AtLeast;
namespace am = ::application_manager;
-using sdl_rpc_plugin::commands::PutFileRequest;
-using sdl_rpc_plugin::commands::PutFileResponse;
using am::commands::MessageSharedPtr;
using policy_test::MockPolicyHandlerInterface;
+using sdl_rpc_plugin::commands::PutFileRequest;
+using sdl_rpc_plugin::commands::PutFileResponse;
typedef std::shared_ptr<PutFileRequest> PutFileRequestPtr;
typedef std::shared_ptr<PutFileResponse> PutFileResponsePtr;
@@ -78,7 +78,9 @@ const int64_t kZeroOffset = 0u;
const std::string kStorageFolder = "./storage";
const std::string kFolder = "folder";
const std::string kAppFolder = "app_folder";
-}
+const am::WindowID kDefaultWindowId =
+ mobile_apis::PredefinedWindows::DEFAULT_WINDOW;
+} // namespace
class PutFileRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
@@ -99,7 +101,7 @@ class PutFileRequestTest
ON_CALL(app_mngr_, application(kConnectionKey))
.WillByDefault(Return(mock_app_));
- ON_CALL(*mock_app_, hmi_level())
+ ON_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
}
@@ -179,7 +181,7 @@ TEST_F(PutFileRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
}
TEST_F(PutFileRequestTest, Run_HmiLevelNone_UNSUCCESS) {
- EXPECT_CALL(*mock_app_, hmi_level())
+ EXPECT_CALL(*mock_app_, hmi_level(kDefaultWindowId))
.WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
const uint32_t settings_put_file_in_none = 1u;
@@ -319,7 +321,8 @@ TEST_F(PutFileRequestTest, Run_SendOnPutFileNotification_SUCCESS) {
mock_rpc_service_,
ManageHMICommand(
HMIResultCodeIs(hmi_apis::FunctionID::BasicCommunication_OnPutFile),
- _)).WillOnce(Return(true));
+ _))
+ .WillOnce(Return(true));
ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));