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" 38 fixed_frame_pose_data { 50 using AddFixedFramePoseDataHandlerTest =
51 testing::HandlerTest<AddFixedFramePoseDataSignature,
52 AddFixedFramePoseDataHandler>;
54 TEST_F(AddFixedFramePoseDataHandlerTest, NoLocalSlamUploader) {
55 proto::AddFixedFramePoseDataRequest request;
57 google::protobuf::TextFormat::ParseFromString(kMessage, &request));
58 SetNoLocalTrajectoryUploader();
59 EXPECT_CALL(*mock_map_builder_context_,
61 Eq(request.sensor_metadata().trajectory_id()),
63 test_server_->SendWrite(request);
64 test_server_->SendWritesDone();
65 test_server_->SendFinish();
68 TEST_F(AddFixedFramePoseDataHandlerTest, WithMockLocalSlamUploader) {
69 proto::AddFixedFramePoseDataRequest request;
71 google::protobuf::TextFormat::ParseFromString(kMessage, &request));
72 SetMockLocalTrajectoryUploader();
73 EXPECT_CALL(*mock_map_builder_context_,
75 Eq(request.sensor_metadata().trajectory_id()),
77 proto::SensorData sensor_data;
78 *sensor_data.mutable_sensor_metadata() = request.sensor_metadata();
79 *sensor_data.mutable_fixed_frame_pose_data() =
80 request.fixed_frame_pose_data();
81 EXPECT_CALL(*mock_local_trajectory_uploader_,
82 DoEnqueueSensorData(Pointee(
84 test_server_->SendWrite(request);
85 test_server_->SendWritesDone();
86 test_server_->SendFinish();
DataPredicateType BuildDataPredicateEquals(const T &proto)
ProtoPredicateType BuildProtoPredicateEquals(const google::protobuf::Message *proto)