20 #include "google/protobuf/text_format.h" 21 #include "gtest/gtest.h" 30 using ::testing::Pointee;
31 using ::testing::Truly;
33 const std::string kMessage = R
"( 36 sensor_id: "sensor_id" 50 using AddOdometryDataHandlerTest =
51 testing::HandlerTest<AddOdometryDataSignature, AddOdometryDataHandler>;
53 TEST_F(AddOdometryDataHandlerTest, NoLocalSlamUploader) {
54 proto::AddOdometryDataRequest request;
56 google::protobuf::TextFormat::ParseFromString(kMessage, &request));
57 SetNoLocalTrajectoryUploader();
58 EXPECT_CALL(*mock_map_builder_context_,
60 Eq(request.sensor_metadata().trajectory_id()),
62 test_server_->SendWrite(request);
63 test_server_->SendWritesDone();
64 test_server_->SendFinish();
67 TEST_F(AddOdometryDataHandlerTest, WithMockLocalSlamUploader) {
68 proto::AddOdometryDataRequest request;
70 google::protobuf::TextFormat::ParseFromString(kMessage, &request));
71 SetMockLocalTrajectoryUploader();
72 EXPECT_CALL(*mock_map_builder_context_,
74 Eq(request.sensor_metadata().trajectory_id()),
76 proto::SensorData sensor_data;
77 *sensor_data.mutable_sensor_metadata() = request.sensor_metadata();
78 *sensor_data.mutable_odometry_data() = request.odometry_data();
79 EXPECT_CALL(*mock_local_trajectory_uploader_,
80 DoEnqueueSensorData(Pointee(
82 test_server_->SendWrite(request);
83 test_server_->SendWritesDone();
84 test_server_->SendFinish();
DataPredicateType BuildDataPredicateEquals(const T &proto)
ProtoPredicateType BuildProtoPredicateEquals(const google::protobuf::Message *proto)