aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/tips/subscriber_test.cc
diff options
context:
space:
mode:
authorGravatar Chen Wang <chenw@google.com>2015-02-02 10:45:17 -0800
committerGravatar Chen Wang <chenw@google.com>2015-02-02 10:45:17 -0800
commitb532ef897340701897975b673d35ef24b5da4825 (patch)
treea10e132f9c38c6b01aff93691736c3e487952939 /examples/tips/subscriber_test.cc
parent0010cdae47270a22fd4442835261c796ee565900 (diff)
Impelment full logic of publish and subcribe.
Diffstat (limited to 'examples/tips/subscriber_test.cc')
-rw-r--r--examples/tips/subscriber_test.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/tips/subscriber_test.cc b/examples/tips/subscriber_test.cc
index 4ff93643ae..9c46718308 100644
--- a/examples/tips/subscriber_test.cc
+++ b/examples/tips/subscriber_test.cc
@@ -73,6 +73,14 @@ class SubscriberServiceImpl : public tech::pubsub::SubscriberService::Service {
return Status::OK;
}
+ Status DeleteSubscription(
+ ServerContext* context,
+ const tech::pubsub::DeleteSubscriptionRequest* request,
+ proto2::Empty* response) override {
+ EXPECT_EQ(request->subscription(), kSubscriptionName);
+ return Status::OK;
+ }
+
Status Pull(ServerContext* context,
const tech::pubsub::PullRequest* request,
tech::pubsub::PullResponse* response) override {
@@ -133,6 +141,8 @@ TEST_F(SubscriberTest, TestSubscriber) {
grpc::string data;
EXPECT_TRUE(subscriber_->Pull(kSubscriptionName,
&data).IsOk());
+
+ EXPECT_TRUE(subscriber_->DeleteSubscription(kSubscriptionName).IsOk());
}
} // namespace