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" 40 landmark_observations { 42 landmark_to_tracking_transform { 50 translation_weight: 11.0 55 using AddLandmarkDataHandlerTest =
56 testing::HandlerTest<AddLandmarkDataSignature, AddLandmarkDataHandler>;
58 TEST_F(AddLandmarkDataHandlerTest, NoLocalSlamUploader) {
59 proto::AddLandmarkDataRequest request;
61 google::protobuf::TextFormat::ParseFromString(kMessage, &request));
62 SetNoLocalTrajectoryUploader();
63 EXPECT_CALL(*mock_map_builder_context_,
65 Eq(request.sensor_metadata().trajectory_id()),
67 test_server_->SendWrite(request);
68 test_server_->SendWritesDone();
69 test_server_->SendFinish();
72 TEST_F(AddLandmarkDataHandlerTest, WithMockLocalSlamUploader) {
73 proto::AddLandmarkDataRequest request;
75 google::protobuf::TextFormat::ParseFromString(kMessage, &request));
76 SetMockLocalTrajectoryUploader();
77 EXPECT_CALL(*mock_map_builder_context_,
79 Eq(request.sensor_metadata().trajectory_id()),
81 proto::SensorData sensor_data;
82 *sensor_data.mutable_sensor_metadata() = request.sensor_metadata();
83 *sensor_data.mutable_landmark_data() = request.landmark_data();
84 EXPECT_CALL(*mock_local_trajectory_uploader_,
85 DoEnqueueSensorData(Pointee(
87 test_server_->SendWrite(request);
88 test_server_->SendWritesDone();
89 test_server_->SendFinish();
DataPredicateType BuildDataPredicateEquals(const T &proto)
ProtoPredicateType BuildProtoPredicateEquals(const google::protobuf::Message *proto)