summaryrefslogtreecommitdiff
path: root/test/components/protocol_handler/include/protocol_handler/protocol_handler_mock.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/components/protocol_handler/include/protocol_handler/protocol_handler_mock.h')
-rw-r--r--test/components/protocol_handler/include/protocol_handler/protocol_handler_mock.h35
1 files changed, 6 insertions, 29 deletions
diff --git a/test/components/protocol_handler/include/protocol_handler/protocol_handler_mock.h b/test/components/protocol_handler/include/protocol_handler/protocol_handler_mock.h
index efa9ecfada..6401c21859 100644
--- a/test/components/protocol_handler/include/protocol_handler/protocol_handler_mock.h
+++ b/test/components/protocol_handler/include/protocol_handler/protocol_handler_mock.h
@@ -68,7 +68,7 @@ class TransportManagerMock: public TransportManager{
MOCK_METHOD1(DisconnectForce,
int(const ConnectionUID &));
MOCK_METHOD1(SendMessageToDevice,
- int(const RawMessageSptr));
+ int(const ::protocol_handler::RawMessagePtr));
MOCK_METHOD1(ReceiveEventFromDevice,
int(const TransportAdapterEvent&));
MOCK_METHOD1(AddTransportAdapter,
@@ -113,6 +113,8 @@ class SessionObserverMock: public protocol_handler::SessionObserver {
const uint8_t sessionId,
const uint32_t& hashCode,
const protocol_handler::ServiceType& service_type));
+ MOCK_METHOD1(OnApplicationFloodCallBack,
+ void(const uint32_t&));
MOCK_METHOD2(KeyFromPair,
uint32_t(
transport_manager::ConnectionUID connection_handle,
@@ -136,6 +138,9 @@ class SessionObserverMock: public protocol_handler::SessionObserver {
MOCK_METHOD2(IsHeartBeatSupported,
bool( transport_manager::ConnectionUID connection_handle,
uint8_t session_id));
+ MOCK_METHOD3(ProtocolVersionUsed,
+ bool(uint32_t connection_id, uint8_t session_id,
+ uint8_t& protocol_version));
};
#ifdef ENABLE_SECURITY
@@ -158,34 +163,6 @@ class SecurityManagerMock: public security_manager::SecurityManager {
const uint32_t ));
};
#endif // ENABLE_SECURITY
-
-/*
- * Matcher for checking RawMessage with InternalError Query
- * Check error id
- */
-MATCHER_P2(ControlMessage, ExpectedFrameData, ExpectedEncryption,
- std::string(ExpectedEncryption ? "Protected" : "Unprotected") + " control message ") {
- // Nack shall be always with flag protected off
- DCHECK(ExpectedFrameData != 0x03 /*FRAME_DATA_START_SERVICE_NACK*/ ||
- !ExpectedEncryption);
- const RawMessagePtr message = arg;
- const ProtocolPacket packet(message->connection_key(), message->data(), message->data_size());
- if (FRAME_TYPE_CONTROL != packet.frame_type()) {
- *result_listener << "Is not control message";
- return false;
- }
- if (ExpectedFrameData != packet.frame_data()) {
- *result_listener << "Control message is not with data 0x"
- << std::hex << (int)ExpectedFrameData;
- return false;
- }
- if (ExpectedEncryption != packet.protection_flag()) {
- *result_listener << "Control message is " <<
- (ExpectedEncryption ? "" : "not ") << "protected";
- return false;
- }
- return true;
-}
} // namespace test
} // namespace components
} // namespace protocol_handler_test