diff --git a/designate_tempest_plugin/tests/api/v2/test_transfer_request.py b/designate_tempest_plugin/tests/api/v2/test_transfer_request.py
index 7b9af10..9bc3897 100644
--- a/designate_tempest_plugin/tests/api/v2/test_transfer_request.py
+++ b/designate_tempest_plugin/tests/api/v2/test_transfer_request.py
@@ -12,6 +12,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 from oslo_log import log as logging
+from tempest.lib.common.utils import data_utils
 from tempest.lib import decorators
 from tempest.lib import exceptions as lib_exc
 
@@ -125,3 +126,73 @@
 
         self.assertRaises(lib_exc.NotFound,
             lambda: self.client.get(uri))
+
+
+class TestTransferRequestNotFound(BaseTransferRequestTest):
+
+    @classmethod
+    def setup_clients(cls):
+        super(TestTransferRequestNotFound, cls).setup_clients()
+        cls.client = cls.os.transfer_request_client
+
+    @decorators.idempotent_id('d255f72f-ba24-43df-9dba-011ed7f4625d')
+    def test_show_transfer_request_404(self):
+        e = self.assertRaises(lib_exc.NotFound,
+                              self.client.show_transfer_request,
+                              data_utils.rand_uuid())
+        self.assertTransferRequest404(e.resp, e.resp_body)
+
+    @decorators.idempotent_id('9ff383fb-c31d-4c6f-8085-7b261e401223')
+    def test_update_transfer_request_404(self):
+        e = self.assertRaises(lib_exc.NotFound,
+                              self.client.update_transfer_request,
+                              data_utils.rand_uuid())
+        self.assertTransferRequest404(e.resp, e.resp_body)
+
+    @decorators.idempotent_id('5a4a0755-c01d-448f-b856-b081b96ae77e')
+    def test_delete_transfer_request_404(self):
+        e = self.assertRaises(lib_exc.NotFound,
+                              self.client.delete_transfer_request,
+                              data_utils.rand_uuid())
+        self.assertTransferRequest404(e.resp, e.resp_body)
+
+    def assertTransferRequest404(self, resp, resp_body):
+        self.assertEqual(404, resp.status)
+        self.assertEqual(404, resp_body['code'])
+        self.assertEqual("zone_transfer_request_not_found", resp_body['type'])
+        self.assertEqual("Could not find ZoneTransferRequest",
+                         resp_body['message'])
+
+
+class TestTransferRequestInvalidId(BaseTransferRequestTest):
+
+    @classmethod
+    def setup_clients(cls):
+        super(TestTransferRequestInvalidId, cls).setup_clients()
+        cls.client = cls.os.transfer_request_client
+
+    @decorators.idempotent_id('2205dd19-ecc7-4c68-9e89-63c47d642b07')
+    def test_show_transfer_request_invalid_uuid(self):
+        e = self.assertRaises(lib_exc.BadRequest,
+                              self.client.show_transfer_request,
+                              'foo')
+        self.assertTransferRequestInvalidId(e.resp, e.resp_body)
+
+    @decorators.idempotent_id('af0ce46f-10be-4cce-a1d5-1b5c2a39fb97')
+    def test_update_transfer_request_invalid_uuid(self):
+        e = self.assertRaises(lib_exc.BadRequest,
+                              self.client.update_transfer_request,
+                              'foo')
+        self.assertTransferRequestInvalidId(e.resp, e.resp_body)
+
+    @decorators.idempotent_id('1728dca5-01f1-45f4-b59d-7a981d479394')
+    def test_delete_transfer_request_invalid_uuid(self):
+        e = self.assertRaises(lib_exc.BadRequest,
+                              self.client.delete_transfer_request,
+                              'foo')
+        self.assertTransferRequestInvalidId(e.resp, e.resp_body)
+
+    def assertTransferRequestInvalidId(self, resp, resp_body):
+        self.assertEqual(400, resp.status)
+        self.assertEqual(400, resp_body['code'])
+        self.assertEqual("invalid_uuid", resp_body['type'])
diff --git a/designate_tempest_plugin/tests/api/v2/test_tsigkey.py b/designate_tempest_plugin/tests/api/v2/test_tsigkey.py
index 2e4ffa9..129c576 100644
--- a/designate_tempest_plugin/tests/api/v2/test_tsigkey.py
+++ b/designate_tempest_plugin/tests/api/v2/test_tsigkey.py
@@ -13,6 +13,7 @@
 #    under the License.
 
 from oslo_log import log as logging
+from tempest.lib.common.utils import data_utils
 from tempest.lib import decorators
 from tempest.lib import exceptions as lib_exc
 
@@ -129,3 +130,78 @@
 
         self.assertRaises(lib_exc.NotFound,
             lambda: self.admin_client.get(uri))
+
+
+class TestTsigkeyNotFoundAdmin(BaseTsigkeyTest):
+
+    credentials = ["admin"]
+
+    @classmethod
+    def setup_clients(cls):
+        super(TestTsigkeyNotFoundAdmin, cls).setup_clients()
+        cls.admin_client = cls.os_adm.tsigkey_client
+
+    @decorators.idempotent_id('824c9b49-edc5-4282-929e-467a158d23e4')
+    def test_show_tsigkey_404(self):
+        e = self.assertRaises(lib_exc.NotFound,
+                              self.admin_client.show_tsigkey,
+                              data_utils.rand_uuid())
+        self.assertTsigkey404(e.resp, e.resp_body)
+
+    @decorators.idempotent_id('4ef3493a-ee66-4c62-b070-c57fa9568b69')
+    def test_update_tsigkey_404(self):
+        e = self.assertRaises(lib_exc.NotFound,
+                              self.admin_client.update_tsigkey,
+                              data_utils.rand_uuid())
+        self.assertTsigkey404(e.resp, e.resp_body)
+
+    @decorators.idempotent_id('ba438ede-4823-4922-8f4c-8de278f3d454')
+    def test_delete_tsigkey_404(self):
+        e = self.assertRaises(lib_exc.NotFound,
+                              self.admin_client.delete_tsigkey,
+                              data_utils.rand_uuid())
+        self.assertTsigkey404(e.resp, e.resp_body)
+
+    def assertTsigkey404(self, resp, resp_body):
+        self.assertEqual(404, resp.status)
+        self.assertEqual(404, resp_body['code'])
+        self.assertEqual("tsigkey_not_found", resp_body['type'])
+        self.assertEqual("Could not find TsigKey", resp_body['message'])
+
+
+class TestTsigkeyInvalidIdAdmin(BaseTsigkeyTest):
+
+    credentials = ["admin"]
+
+    @classmethod
+    def setup_clients(cls):
+        super(TestTsigkeyInvalidIdAdmin, cls).setup_clients()
+        cls.admin_client = cls.os_adm.tsigkey_client
+
+    @decorators.idempotent_id('2a8dfc75-9884-4b1c-8f1f-ed835d96f2fe')
+    def test_show_tsigkey_invalid_uuid(self):
+        e = self.assertRaises(lib_exc.BadRequest,
+                              self.admin_client.show_tsigkey,
+                              'foo')
+        self.assertTsigkeyInvalidId(e.resp, e.resp_body)
+
+    @decorators.idempotent_id('2befa10f-fc42-4ae9-9276-672e23f045f2')
+    def test_update_tsigkey_invalid_uuid(self):
+        e = self.assertRaises(lib_exc.BadRequest,
+                              self.admin_client.update_tsigkey,
+                              'foo')
+        self.assertTsigkeyInvalidId(e.resp, e.resp_body)
+
+    @decorators.idempotent_id('55c2fea0-ead6-44c7-8bb1-05111412afdd')
+    def test_delete_tsigkey_invalid_uuid(self):
+        e = self.assertRaises(lib_exc.BadRequest,
+                              self.admin_client.delete_tsigkey,
+                              'foo')
+        self.assertTsigkeyInvalidId(e.resp, e.resp_body)
+
+    def assertTsigkeyInvalidId(self, resp, resp_body):
+        self.assertEqual(400, resp.status)
+        self.assertEqual(400, resp_body['code'])
+        self.assertEqual("invalid_uuid", resp_body['type'])
+        self.assertEqual("Invalid UUID tsigkey_id: foo",
+                         resp_body['message'])
