Debian Codegraph @

unittest/gunit/xplugin/xpl/mock/session.h

raw symbols SCIP
1 /*
2 * Copyright (c) 2015, 2026, Oracle and/or its affiliates.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License, version 2.0,
6 * as published by the Free Software Foundation.
7 *
8 * This program is designed to work with certain software (including
9 * but not limited to OpenSSL) that is licensed under separate terms,
10 * as designated in a particular file or component or in included license
11 * documentation. The authors of MySQL hereby grant you an additional
12 * permission to link the program and your derivative works with the
13 * separately licensed software that they have either included with
14 * the program or referenced in the documentation.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License, version 2.0, for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 */
25
26 #ifndef UNITTEST_GUNIT_XPLUGIN_XPL_MOCK_SESSION_H_
27 #define UNITTEST_GUNIT_XPLUGIN_XPL_MOCK_SESSION_H_
28
29 #include <gmock/gmock.h>
30 #include <string>
31
32 #include "plugin/x/src/interface/client.h"
33 #include "plugin/x/src/interface/session.h"
34
35 namespace xpl {
36 namespace test {
37 namespace mock {
38
39 class Session : public iface::Session {
40 public:
41 Session();
42 virtual ~Session() override;
43
44 MOCK_METHOD(Session_id, session_id, (), (const, override));
45 MOCK_METHOD(ngs::Error_code, init, (), (override));
46 MOCK_METHOD(void, on_close, (const Close_flags), (override));
47 MOCK_METHOD(void, on_kill, (), (override));
48 MOCK_METHOD(void, on_auth_success, (const iface::Authentication::Response &),
49 (override));
50 MOCK_METHOD(void, on_auth_failure, (const iface::Authentication::Response &),
51 (override));
52 MOCK_METHOD(void, on_reset, (), (override));
53 MOCK_METHOD(bool, handle_message, (const ngs::Message_request &), (override));
54 MOCK_METHOD(State, state, (), (const, override));
55 MOCK_METHOD(State, state_before_close, (), (const, override));
56 MOCK_METHOD(ngs::Session_status_variables &, get_status_variables, (),
57 (override));
58 MOCK_METHOD(iface::Client &, client, (), (override));
59 MOCK_METHOD(const iface::Client &, client, (), (const, override));
60 MOCK_METHOD(bool, can_see_user, (const std::string &), (const, override));
61
62 MOCK_METHOD(void, mark_as_tls_session, (), (override));
63 MOCK_METHOD(THD *, get_thd, (), (const, override));
64 MOCK_METHOD(iface::Sql_session &, data_context, (), (override));
65 MOCK_METHOD(iface::Protocol_encoder &, proto, (), (override));
66 MOCK_METHOD(void, set_proto, (iface::Protocol_encoder *), (override));
67 MOCK_METHOD(iface::Notice_configuration &, get_notice_configuration, (),
68 (override));
69 MOCK_METHOD(iface::Notice_output_queue &, get_notice_output_queue, (),
70 (override));
71 MOCK_METHOD(bool, get_prepared_statement_id, (const uint32_t, uint32_t *),
72 (const, override));
73 MOCK_METHOD(
74 void, update_status,
75 (ngs::Common_status_variables::Variable ngs::Common_status_variables::*),
76 (override));
77 MOCK_METHOD(iface::Document_id_aggregator &, get_document_id_aggregator, (),
78 (override));
79 };
80
81 } // namespace mock
82 } // namespace test
83 } // namespace xpl
84
85 #endif // UNITTEST_GUNIT_XPLUGIN_XPL_MOCK_SESSION_H_