TensorFlow Serving C++ API Documentation
mock_prediction_stream_logger.h
1 /* Copyright 2023 Google Inc. All Rights Reserved.
2 
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6 
7  http://www.apache.org/licenses/LICENSE-2.0
8 
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 ==============================================================================*/
15 
16 #ifndef THIRD_PARTY_TENSORFLOW_SERVING_CORE_TEST_UTIL_MOCK_PREDICTION_STREAM_LOGGER_H_
17 #define THIRD_PARTY_TENSORFLOW_SERVING_CORE_TEST_UTIL_MOCK_PREDICTION_STREAM_LOGGER_H_
18 
19 #include <memory>
20 
21 #include <gmock/gmock.h>
22 #include "tensorflow_serving/apis/logging.pb.h"
23 #include "tensorflow_serving/apis/predict.pb.h"
24 #include "tensorflow_serving/core/stream_logger.h"
25 
26 namespace tensorflow {
27 namespace serving {
28 namespace test_util {
29 
31  : public StreamLogger<PredictRequest, PredictResponse> {
32  public:
33  ~MockPredictionStreamLogger() override = default;
34 
35  MOCK_METHOD(void, LogStreamRequest, (PredictRequest), (override));
36  MOCK_METHOD(void, LogStreamResponse, (PredictResponse), (override));
37  MOCK_METHOD(absl::Status, CreateLogMessage,
38  (const LogMetadata&, std::unique_ptr<google::protobuf::Message>*),
39  (override));
40 };
41 
42 } // namespace test_util
43 } // namespace serving
44 } // namespace tensorflow
45 
46 #endif // THIRD_PARTY_TENSORFLOW_SERVING_CORE_TEST_UTIL_MOCK_PREDICTION_STREAM_LOGGER_H_