proxygen
Mocks.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include <gmock/gmock.h>
20 
21 namespace wangle {
22 
24  public:
25  MOCK_METHOD2(setSSLSessionInternal, void(const std::string&, SSL_SESSION*));
26 
27  MOCK_CONST_METHOD1(getSSLSessionInternal, SSL_SESSION*(const std::string&));
28 
29  MOCK_METHOD1(removeSSLSessionInternal, bool(const std::string&));
30 
32  const std::string& host) const noexcept override {
33  return SSLSessionPtr(getSSLSessionInternal(host));
34  }
35 
37  const std::string& host,
38  SSLSessionPtr session) noexcept override {
39  setSSLSessionInternal(host, session.release());
40  }
41 
42  bool removeSSLSession(const std::string& identity) noexcept override {
43  return removeSSLSessionInternal(identity);
44  }
45 };
46 
47 }
MOCK_METHOD1(removeSSLSessionInternal, bool(const std::string &))
MOCK_CONST_METHOD1(getSSLSessionInternal, SSL_SESSION *(const std::string &))
requires E e noexcept(noexcept(s.error(std::move(e))))
std::unique_ptr< SSL_SESSION, SessionDestructor > SSLSessionPtr
Definition: SSLSession.h:32
void setSSLSession(const std::string &host, SSLSessionPtr session) noexceptoverride
Definition: Mocks.h:36
MOCK_METHOD2(setSSLSessionInternal, void(const std::string &, SSL_SESSION *))
bool removeSSLSession(const std::string &identity) noexceptoverride
Definition: Mocks.h:42
const char * string
Definition: Conv.cpp:212
SSLSessionPtr getSSLSession(const std::string &host) const noexceptoverride
Definition: Mocks.h:31