summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsniukalov <sniukaov@luxoft.com>2020-02-11 15:41:06 +0200
committersniukalov <sniukaov@luxoft.com>2020-02-11 15:41:06 +0200
commit654d6d8d9c2c90574ecc9e4014bc68df2398daa9 (patch)
tree48e56d6fb1da3f10cf2f24b5bdaa23f324315ed0
parenta8443e71f3d2c93c61eb22c33c778144f2b0a74c (diff)
downloadsdl_core-654d6d8d9c2c90574ecc9e4014bc68df2398daa9.tar.gz
fixup! Add Server WebSocket transport
-rw-r--r--src/components/config_profile/include/config_profile/profile.h2
-rw-r--r--src/components/config_profile/src/profile.cc2
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager_settings.h2
-rw-r--r--src/components/include/transport_manager/transport_manager_settings.h2
-rw-r--r--src/components/transport_manager/src/websocket/websocket_listener.cc2
-rw-r--r--src/components/transport_manager/test/websocket_server_listener_test.cc8
6 files changed, 9 insertions, 9 deletions
diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h
index 897f7a69ef..76c66c7c7b 100644
--- a/src/components/config_profile/include/config_profile/profile.h
+++ b/src/components/config_profile/include/config_profile/profile.h
@@ -443,7 +443,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
* @brief Returns bool flag indicating whether WSS settings were setup
* correctly
*/
- const bool is_wss_settings_setup() const OVERRIDE;
+ const bool wss_server_supported() const OVERRIDE;
#endif // ENABLE_SECURITY
#endif // WEBSOCKET_SERVER_TRANSPORT_SUPPORT
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc
index 09802f39fa..3037b66fdd 100644
--- a/src/components/config_profile/src/profile.cc
+++ b/src/components/config_profile/src/profile.cc
@@ -867,7 +867,7 @@ const std::string& Profile::ws_server_ca_cert_path() const {
return ws_server_ca_cert_path_;
}
-const bool Profile::is_wss_settings_setup() const {
+const bool Profile::wss_server_supported() const {
return is_wss_settings_setup_;
}
#endif // ENABLE_SECURITY
diff --git a/src/components/include/test/transport_manager/mock_transport_manager_settings.h b/src/components/include/test/transport_manager/mock_transport_manager_settings.h
index 692ad50b58..10320d51ab 100644
--- a/src/components/include/test/transport_manager/mock_transport_manager_settings.h
+++ b/src/components/include/test/transport_manager/mock_transport_manager_settings.h
@@ -77,7 +77,7 @@ class MockTransportManagerSettings
MOCK_CONST_METHOD0(ws_server_cert_path, const std::string&());
MOCK_CONST_METHOD0(ws_server_key_path, const std::string&());
MOCK_CONST_METHOD0(ws_server_ca_cert_path, const std::string&());
- MOCK_CONST_METHOD0(is_wss_settings_setup, const bool());
+ MOCK_CONST_METHOD0(wss_server_supported, const bool());
};
} // namespace transport_manager_test
diff --git a/src/components/include/transport_manager/transport_manager_settings.h b/src/components/include/transport_manager/transport_manager_settings.h
index ce41da2e2b..fee5b031ed 100644
--- a/src/components/include/transport_manager/transport_manager_settings.h
+++ b/src/components/include/transport_manager/transport_manager_settings.h
@@ -84,7 +84,7 @@ class TransportManagerSettings : public TransportManagerMMESettings {
virtual const std::string& ws_server_cert_path() const = 0;
virtual const std::string& ws_server_key_path() const = 0;
virtual const std::string& ws_server_ca_cert_path() const = 0;
- virtual const bool is_wss_settings_setup() const = 0;
+ virtual const bool wss_server_supported() const = 0;
#endif // ENABLE_SECURITY
#endif // WEBSOCKET_SERVER_TRANSPORT_SUPPORT
/**
diff --git a/src/components/transport_manager/src/websocket/websocket_listener.cc b/src/components/transport_manager/src/websocket/websocket_listener.cc
index 1086607cb3..6c31948d51 100644
--- a/src/components/transport_manager/src/websocket/websocket_listener.cc
+++ b/src/components/transport_manager/src/websocket/websocket_listener.cc
@@ -117,7 +117,7 @@ TransportAdapter::Error WebSocketListener::AddCertificateAuthority() {
LOG4CXX_DEBUG(logger_, "Path to key : " << key_path);
const auto ca_cert_path = settings_.ws_server_ca_cert_path();
LOG4CXX_DEBUG(logger_, "Path to ca cert : " << ca_cert_path);
- start_secure_ = settings_.is_wss_settings_setup();
+ start_secure_ = settings_.wss_server_supported();
if (start_secure_ && (!file_system::FileExists(cert_path) ||
!file_system::FileExists(key_path) ||
diff --git a/src/components/transport_manager/test/websocket_server_listener_test.cc b/src/components/transport_manager/test/websocket_server_listener_test.cc
index 6f12173cad..32b2960fb9 100644
--- a/src/components/transport_manager/test/websocket_server_listener_test.cc
+++ b/src/components/transport_manager/test/websocket_server_listener_test.cc
@@ -93,7 +93,7 @@ class WebSocketListenerTest : public ::testing::Test {
.WillByDefault(ReturnRef(kServerKey));
ON_CALL(mock_tm_settings_, ws_server_ca_cert_path())
.WillByDefault(ReturnRef(kCACert));
- ON_CALL(mock_tm_settings_, is_wss_settings_setup())
+ ON_CALL(mock_tm_settings_, wss_server_supported())
.WillByDefault(Return(true));
}
@@ -110,7 +110,7 @@ TEST_F(WebSocketListenerTest, StartListening_ClientConnect_SUCCESS) {
.WillByDefault(ReturnRef(kDefaultKeyPath));
ON_CALL(mock_tm_settings_, ws_server_ca_cert_path())
.WillByDefault(ReturnRef(kDefaultCACertPath));
- ON_CALL(mock_tm_settings_, is_wss_settings_setup())
+ ON_CALL(mock_tm_settings_, wss_server_supported())
.WillByDefault(Return(false));
const auto ws_listener = std::make_shared<WebSocketListener>(
@@ -213,7 +213,7 @@ TEST_F(WebSocketListenerTest, StartListening_BindToTheServerAddress_FAIL) {
.WillByDefault(ReturnRef(kDefaultCertPath));
ON_CALL(mock_tm_settings_, ws_server_key_path())
.WillByDefault(ReturnRef(kDefaultKeyPath));
- ON_CALL(mock_tm_settings_, is_wss_settings_setup())
+ ON_CALL(mock_tm_settings_, wss_server_supported())
.WillByDefault(Return(false));
EXPECT_CALL(mock_tm_settings_, ws_server_ca_cert_path())
.WillOnce(ReturnRef(kDefaultCACertPath));
@@ -233,7 +233,7 @@ TEST_F(WebSocketListenerTest, StartListening_AcceptorIsOpen_SUCCESS) {
.WillByDefault(ReturnRef(kDefaultCertPath));
ON_CALL(mock_tm_settings_, ws_server_key_path())
.WillByDefault(ReturnRef(kDefaultKeyPath));
- ON_CALL(mock_tm_settings_, is_wss_settings_setup())
+ ON_CALL(mock_tm_settings_, wss_server_supported())
.WillByDefault(Return(false));
EXPECT_CALL(mock_ta_controller_, ConnectDone(_, _));