message: Implemented test for UNSUPPORTED_REQUEST response(forwarded to mobile)
diff: @@ -196,7 +196,8 @@ class RPCPassingHandlerTest : public ::testing::Test {
  .WillOnce(Return(app_services_));
  EXPECT_CALL(
  mock_app_manager_,
  - IncreaseForwardedRequestTimeout(connection_key, correlation_id));
  + IncreaseForwardedRequestTimeout(connection_key, correlation_id))
  + .Times(app_services_.size());
  // Will call ForwardRequesttoMobile
  EXPECT_CALL(mock_app_manager_, get_settings());
  @@ -238,33 +239,6 @@ TEST_F(RPCPassingHandlerTest, RPCPassingTest_REQUEST_ForwardToMobile) {
  SendPassthroughRequestToMobile(connection_key, correlation_id);
  }
  -// TEST_F(RPCPassingHandlerTest, RPCPassingTest_REQUEST_DuplicateCorrelationID)
  -// {
  -// int32_t correlation_id = 1;
  -// uint32_t connection_key = 1;
  -// app_services_.push_back(CreateAppService(connection_key + 1, "service 1",
  -// "NAVIGATION"));
  -
  -// SendPassthroughRequestToMobile(connection_key, correlation_id);
  -// smart_objects::SmartObject request = CreatePassThroughRequest(connection_key,
  -// correlation_id);
  -
  -// {
  -// InSequence dummy;
  -// // Call RPCPassThrough with request smart object
  -// // Will return true and send error message since correlation id already
  -// exists in map
  -// // FAILING ON NegativeResponse(The mock function has no default action set)
  -// EXPECT_CALL(mock_app_manager_, GetRPCService());
  -// EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_,
  -// am::commands::Command::SOURCE_SDL));
  -// }
  -
  -// bool result = rpc_passing_handler_->RPCPassThrough(request);
  -// EXPECT_EQ(result, true);
  -
  -// }
  -
  TEST_F(RPCPassingHandlerTest, RPCPassingTest_REQUEST_NoPassthrough) {
  int32_t correlation_id = 1;
  uint32_t connection_key = 1;
  @@ -369,6 +343,36 @@ TEST_F(RPCPassingHandlerTest,
  EXPECT_EQ(result, true);
  }
  +TEST_F(RPCPassingHandlerTest,
  + RPCPassingTest_UNSUPPORTED_REQUEST_ForwardToMobile) {
  + int32_t correlation_id = 1;
  + uint32_t connection_key = 1;
  + smart_objects::SmartObject unsupported_response = CreatePassThroughResponse(
  + connection_key + 1, correlation_id, "UNSUPPORTED_REQUEST", false);
  + smart_objects::SmartObject forwarded_request =
  + CreatePassThroughRequest(connection_key + 2, correlation_id);
  +
  + app_services_.push_back(
  + CreateAppService(connection_key + 1, "service 1", "NAVIGATION"));
  + app_services_.push_back(
  + CreateAppService(connection_key + 2, "service 2", "MEDIA"));
  +
  + SendPassthroughRequestToMobile(connection_key, correlation_id);
  +
  + {
  + InSequence dummy;
  + // Call RPCPassThrough with response smart object
  + // Will cycle to core (no other app services in list)
  + EXPECT_CALL(mock_app_manager_, get_settings());
  + EXPECT_CALL(mock_app_manager_settings_, rpc_pass_through_timeout());
  + EXPECT_CALL(mock_app_manager_, GetRPCService());
  + EXPECT_CALL(mock_rpc_service_,
  + SendMessageToMobile(Pointee(forwarded_request), false));
  + }
  + bool result = rpc_passing_handler_->RPCPassThrough(unsupported_response);
  + EXPECT_EQ(result, true);
  +}
  +
  } // namespace application_manager_test
  } // namespace components
  } // namespace test
  