summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCollin <iCollin@users.noreply.github.com>2021-05-20 14:34:30 -0400
committerGitHub <noreply@github.com>2021-05-20 14:34:30 -0400
commit03c951b5f76cbc855e2ebbc412307ce4de446b92 (patch)
treeb051c8535cdbe807ea966cd0fe6206caeec99d01
parent84b0746527f58ab412cf6ba9205e1467dfcf0c6f (diff)
downloadsdl_core-03c951b5f76cbc855e2ebbc412307ce4de446b92.tar.gz
when non-existent app sends request reply app not registered (#3705)
* when non-existant app sends request reply app not registered * fix unit tests
-rw-r--r--src/components/application_manager/src/commands/command_impl.cc6
-rw-r--r--src/components/application_manager/test/commands/command_request_impl_test.cc3
2 files changed, 9 insertions, 0 deletions
diff --git a/src/components/application_manager/src/commands/command_impl.cc b/src/components/application_manager/src/commands/command_impl.cc
index 9efcaa451a..25bbffecf6 100644
--- a/src/components/application_manager/src/commands/command_impl.cc
+++ b/src/components/application_manager/src/commands/command_impl.cc
@@ -159,6 +159,12 @@ bool CommandImpl::CheckAllowedParameters(const Command::CommandSource source) {
"There is no registered application with "
"connection key '"
<< connection_key() << "'");
+
+ rpc_service_.SendMessageToMobile(MessageHelper::CreateNegativeResponse(
+ connection_key(),
+ function_id(),
+ correlation_id(),
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED));
return false;
}
diff --git a/src/components/application_manager/test/commands/command_request_impl_test.cc b/src/components/application_manager/test/commands/command_request_impl_test.cc
index 6470988680..7beda06d8a 100644
--- a/src/components/application_manager/test/commands/command_request_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_request_impl_test.cc
@@ -363,6 +363,9 @@ TEST_F(CommandRequestImplTest,
MessageSharedPtr message = CreateMessage();
CommandPtr command = CreateCommand<UCommandRequestImpl>(message);
EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(MockAppPtr()));
+ MessageSharedPtr dummy_msg(CreateMessage());
+ EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
+ .WillOnce(Return(dummy_msg));
EXPECT_FALSE(command->CheckPermissions());
}