16 #ifndef TENSORFLOW_SERVING_CORE_TEST_UTIL_MOCK_REQUEST_LOGGER_H_
17 #define TENSORFLOW_SERVING_CORE_TEST_UTIL_MOCK_REQUEST_LOGGER_H_
21 #include "google/protobuf/message.h"
22 #include <gmock/gmock.h>
23 #include "tensorflow/core/lib/core/status.h"
24 #include "tensorflow_serving/apis/logging.pb.h"
25 #include "tensorflow_serving/config/logging_config.pb.h"
26 #include "tensorflow_serving/core/log_collector.h"
27 #include "tensorflow_serving/core/request_logger.h"
29 namespace tensorflow {
37 const std::vector<string>& saved_model_tags,
39 std::function<
void(
void)> notify_destruction =
40 std::function<
void(
void)>())
42 std::unique_ptr<LogCollector>(log_collector)),
43 notify_destruction_(std::move(notify_destruction)) {}
46 if (notify_destruction_) {
47 notify_destruction_();
51 MOCK_METHOD(Status, CreateLogMessage,
52 (
const google::protobuf::Message& request,
const google::protobuf::Message& response,
53 const LogMetadata& log_metadata,
54 std::unique_ptr<google::protobuf::Message>* log),
57 MOCK_METHOD(LogMetadata, FillLogMetadata, (
const LogMetadata&), (
override));
60 std::function<void(
void)> notify_destruction_;