public void TestTopicIamPolicyPermissions()
        {
            string topicId = "testTopicForTestTopicIamPolicy";

            CreateTopic(topicId, _publisher);
            SetTopicIamPolicy(topicId, _publisher);
            TestIamPermissionsResponse response =
                TestTopicIamPermissionsResponse(topicId, _publisher);

            Assert.NotEmpty(response.ToString());
            DeleteTopic(topicId, _publisher);
        }
Example #2
0
        public void TestTopicIamPolicyPermissions()
        {
            string topicId = "testTopicForTestTopicIamPolicy";
            string testRoleValueToConfirm   = "pubsub.editor";
            string testMemberValueToConfirm = "group:[email protected]";
            var    topicCreateOutput        = Run("createTopic", _projectId, topicId);
            var    setTopicIamPolicyOutput  = Run("setTopicIamPolicy", _projectId,
                                                  topicId, testRoleValueToConfirm, testMemberValueToConfirm);
            TestIamPermissionsResponse response =
                TestTopicIamPermissionsResponse(topicId, _publisher);

            Assert.NotEmpty(response.ToString());
        }
        public void TestSubscriptionIamPolicyPermissions()
        {
            string topicId        = "testTopicForTestSubscriptionIamPolicy";
            string subscriptionId = "testSubscriptionForTestSubscriptionIamPolicy";

            CreateTopic(topicId, _publisher);
            CreateSubscription(topicId, subscriptionId, _subscriber);
            SetSubscriptionIamPolicy(subscriptionId, _publisher);
            TestIamPermissionsResponse response =
                TestSubscriptionIamPermissionsResponse(subscriptionId, _publisher);

            Assert.NotEmpty(response.ToString());
            DeleteSubscription(subscriptionId, _subscriber);
            DeleteTopic(topicId, _publisher);
        }
        public void TestSubscriptionPolicyPermisssions()
        {
            string topicId                  = "testTopicForTestSubscriptionIamPolicy" + TestUtil.RandomName();
            string subscriptionId           = "testSubscriptionForTestSubscriptionIamPolicy" + TestUtil.RandomName();
            string testRoleValueToConfirm   = "pubsub.editor";
            string testMemberValueToConfirm = "group:[email protected]";
            var    topicCreateOutput        = Run("createTopic", _projectId, topicId);
            var    subcriptionCreateOutput  = Run("createSubscription", _projectId,
                                                  topicId, subscriptionId);

            Run("setSubscriptionIamPolicy", _projectId,
                subscriptionId, testRoleValueToConfirm, testMemberValueToConfirm);
            TestIamPermissionsResponse response =
                TestSubscriptionIamPermissionsResponse(subscriptionId, _publisher);

            Assert.NotEmpty(response.ToString());
        }