test/common/config/grpc_mux_impl_test.cc
// Validate behavior when multiple type URL watches are maintained, watches are created/destroyed
// (via RAII).
Validate behavior when multiple type URL watches are maintained, watches are created/destroyed
(via RAII).
Validate behavior when multiple type URL watches are maintained watches are created / destroyed ( via RAII ) .
TEST_F(GrpcMuxImplTest, MultipleTypeUrlStreams) {
  setup();
  InSequence s;
  auto foo_sub = grpc_mux_->subscribe("foo", {"x", "y"}, callbacks_);
  auto bar_sub = grpc_mux_->subscribe("bar", {}, callbacks_);
  EXPECT_CALL(*async_client_, start(_, _)).WillOnce(Return(&async_stream_));
  expectSendMessage("foo", {"x", "y"}, "");
  expectSendMessage("bar", {}, "");
  grpc_mux_->start();
  EXPECT_EQ(1, stats_.gauge("control_plane.connected_state").value());
  expectSendMessage("bar", {"z"}, "");
  auto bar_z_sub = grpc_mux_->subscribe("bar", {"z"}, callbacks_);
  expectSendMessage("bar", {"zz", "z"}, "");
  auto bar_zz_sub = grpc_mux_->subscribe("bar", {"zz"}, callbacks_);
  expectSendMessage("bar", {"z"}, "");
  expectSendMessage("bar", {}, "");
  expectSendMessage("foo", {}, "");
}
TEST_F ( GrpcMuxImplTest , MultipleTypeUrlStreams ) { setup ( ) ; InSequence s ; auto foo_sub = grpc_mux_ -> subscribe ( " " , { " " , " " } , callbacks_ ) ; auto bar_sub = grpc_mux_ -> subscribe ( " " , { } , callbacks_ ) ; EXPECT_CALL ( * async_client_ , start ( _ , _ ) ) . WillOnce ( Return ( & async_stream_ ) ) ; expectSendMessage ( " " , { " " , " " } , " " ) ; expectSendMessage ( " " , { } , " " ) ; grpc_mux_ -> start ( ) ; EXPECT_EQ ( 1 , stats_ . gauge ( " " ) . value ( ) ) ; expectSendMessage ( " " , { " " } , " " ) ; auto bar_z_sub = grpc_mux_ -> subscribe ( " " , { " " } , callbacks_ ) ; expectSendMessage ( " " , { " " , " " } , " " ) ; auto bar_zz_sub = grpc_mux_ -> subscribe ( " " , { " " } , callbacks_ ) ; expectSendMessage ( " " , { " " } , " " ) ; expectSendMessage ( " " , { } , " " ) ; expectSendMessage ( " " , { } , " " ) ; }
Validate behavior when multiple type URL watches are maintained, watches are created/destroyed
(via RAII).
Validate behavior when multiple type URL watches are maintained watches are created / destroyed ( via RAII ) .