@@ -0,0 +1,2300 @@
+# Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A# not use this file except in compliance with the License. You may obtain%0A# a copy of the License at%0A#%0A#      http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A# License for the specific language governing permissions and limitations%0A# under the License.%0A%0Afrom tempest.lib import decorators%0A%0Afrom senlin.tests.tempest.api import base%0Afrom senlin.tests.tempest.common import constants%0A%0A%0Aclass TestReceiverList(base.BaseSenlinTest):%0A%0A    @classmethod%0A    def resource_setup(cls):%0A        super(TestReceiverList, cls).resource_setup()%0A        # Create profile%0A        cls.profile = cls.create_profile(constants.spec_nova_server)%0A        # Create a test cluster%0A        cls.cluster = cls.create_test_cluster(cls.profile%5B'id'%5D,%0A                                              0, min_size=0, max_size=-1)%0A        # Create receiver%0A        cls.receiver = cls.create_receiver(cls.cluster%5B'id'%5D,%0A                                           'CLUSTER_RESIZE', 'webhook')%0A%0A    @classmethod%0A    def resource_cleanup(cls):%0A        # Delete receiver%0A        cls.client.delete_obj('receivers', cls.receiver%5B'id'%5D)%0A        # Delete test cluster%0A        cls.delete_test_cluster(cls.cluster%5B'id'%5D)%0A        # Delete profile%0A        cls.delete_profile(cls.profile%5B'id'%5D)%0A        super(TestReceiverList, cls).resource_cleanup()%0A%0A    @decorators.idempotent_id('e5cedce0-9240-45ea-90d7-692be5058aac')%0A    def test_list_receiver(self):%0A        res = self.client.list_objs('receivers')%0A%0A        self.assertEqual(200, res%5B'status'%5D)%0A        self.assertIsNone(res%5B'location'%5D)%0A        self.assertIsNotNone(res%5B'body'%5D)%0A        receivers = res%5B'body'%5D%0A        ids = %5B%5D%0A        for receiver in receivers:%0A            for key in %5B'action', 'actor', 'channel', 'cluster_id',%0A                        'created_at', 'domain', 'id', 'name', 'params',%0A                        'project', 'type', 'updated_at', 'user'%5D:%0A                self.assertIn(key, receiver)%0A            ids.append(receiver%5B'id'%5D)%0A        self.assertIn(self.receiver%5B'id'%5D, ids)%0A

Add API test for receiver list