diff --git a/tempest/services/identity/json/admin_client.py b/tempest/services/identity/json/admin_client.py
index 314814e..b5aef5f 100644
--- a/tempest/services/identity/json/admin_client.py
+++ b/tempest/services/identity/json/admin_client.py
@@ -57,28 +57,26 @@
         resp, body = self.delete('OS-KSADM/roles/%s' % str(role_id))
         return resp, body
 
-    def list_user_roles(self, user_id):
+    def list_user_roles(self, tenant_id, user_id):
         """Returns a list of roles assigned to a user for a tenant"""
-        resp, body = self.get('users/%s/roleRefs' % user_id)
+        url = '/tenants/%s/users/%s/roles' % (tenant_id, user_id)
+        resp, body = self.get(url)
         body = json.loads(body)
         return resp, body['roles']
 
-    def assign_user_role(self, user_id, role_id, tenant_id):
-        """Assigns a role to a user for a tenant"""
-        post_body = {
-                'roleId': role_id,
-                'tenantId': tenant_id
-        }
-        post_body = json.dumps({'role': post_body})
-        resp, body = self.post('users/%s/roleRefs' % user_id, post_body,
-                                self.headers)
+    def assign_user_role(self, tenant_id, user_id, role_id):
+        """Add roles to a user on a tenant"""
+        post_body = json.dumps({})
+        resp, body = self.put('/tenants/%s/users/%s/roles/OS-KSADM/%s'
+                                % (tenant_id, user_id, role_id), post_body,
+                                   self.headers)
         body = json.loads(body)
         return resp, body['role']
 
-    def remove_user_role(self, user_id, role_id):
+    def remove_user_role(self, tenant_id, user_id, role_id):
         """Removes a role assignment for a user on a tenant"""
-        resp, body = self.delete('users/%s/roleRefs/%s' % (user_id, role_id))
-        return resp, body
+        return self.delete('/tenants/%s/users/%s/roles/OS-KSADM/%s'
+               % (tenant_id, user_id, role_id))
 
     def delete_tenant(self, tenant_id):
         """Delete a tenant"""
diff --git a/tempest/tests/identity/admin/test_roles.py b/tempest/tests/identity/admin/test_roles.py
index dec7d48..4256da5 100644
--- a/tempest/tests/identity/admin/test_roles.py
+++ b/tempest/tests/identity/admin/test_roles.py
@@ -110,16 +110,17 @@
     def test_assign_user_role(self):
         """Assign a role to a user on a tenant"""
         (user, tenant, role) = self._get_role_params()
-        self.client.assign_user_role(user['id'], role['id'], tenant['id'])
-        resp, roles = self.client.list_user_roles(user['id'])
-        self.assertEquals(tenant['id'], roles[0]['tenantId'])
+        self.client.assign_user_role(tenant['id'], user['id'], role['id'])
+        resp, roles = self.client.list_user_roles(tenant['id'], user['id'])
+        self.assertEquals(1, len(roles))
+        self.assertEquals(roles[0]['id'], role['id'])
 
     def test_assign_user_role_by_unauthorized_user(self):
         """Non admin user should not be authorized to assign a role to user"""
         (user, tenant, role) = self._get_role_params()
         self.assertRaises(exceptions.Unauthorized,
                           self.non_admin_client.assign_user_role,
-                          user['id'], role['id'], tenant['id'])
+                          tenant['id'], user['id'], role['id'])
 
     def test_assign_user_role_request_without_token(self):
         """Request to assign a role to a user without a valid token"""
@@ -127,95 +128,109 @@
         token = self.client.get_auth()
         self.client.delete_token(token)
         self.assertRaises(exceptions.Unauthorized,
-                          self.client.assign_user_role, user['id'], role['id'],
-                          tenant['id'])
+                          self.client.assign_user_role, tenant['id'],
+                          user['id'], role['id'])
         self.client.clear_auth()
 
     def test_assign_user_role_for_non_existent_user(self):
         """Attempt to assign a role to a non existent user should fail"""
         (user, tenant, role) = self._get_role_params()
         self.assertRaises(exceptions.NotFound, self.client.assign_user_role,
-                         'junk-user-id-999', role['id'], tenant['id'])
+                         tenant['id'], 'junk-user-id-999', role['id'])
 
     def test_assign_user_role_for_non_existent_role(self):
         """Attempt to assign a non existent role to user should fail"""
         (user, tenant, role) = self._get_role_params()
         self.assertRaises(exceptions.NotFound, self.client.assign_user_role,
-                         user['id'], 'junk-role-id-12345', tenant['id'])
+                         tenant['id'], user['id'], 'junk-role-id-12345')
 
     def test_assign_user_role_for_non_existent_tenant(self):
         """Attempt to assign a role on a non existent tenant should fail"""
         (user, tenant, role) = self._get_role_params()
         self.assertRaises(exceptions.NotFound, self.client.assign_user_role,
-                         user['id'], role['id'], 'junk-tenant-1234')
+                         'junk-tenant-1234', user['id'], role['id'])
 
     def test_assign_duplicate_user_role(self):
         """Duplicate user role should not get assigned"""
         (user, tenant, role) = self._get_role_params()
-        self.client.assign_user_role(user['id'], role['id'], tenant['id'])
+        self.client.assign_user_role(tenant['id'], user['id'], role['id'])
         self.assertRaises(exceptions.Duplicate, self.client.assign_user_role,
-                          user['id'], role['id'], tenant['id'])
+                          tenant['id'], user['id'], role['id'])
 
-    @unittest.skip("Until Bug 999219 is fixed")
     def test_remove_user_role(self):
         """Remove a role assigned to a user on a tenant"""
         (user, tenant, role) = self._get_role_params()
-        resp, user_role = self.client.assign_user_role(user['id'], role['id'],
-                                                       tenant['id'])
-        resp, body = self.client.remove_user_role(user['id'], user_role['id'])
+        resp, user_role = self.client.assign_user_role(tenant['id'],
+                                                       user['id'], role['id'])
+        resp, body = self.client.remove_user_role(tenant['id'], user['id'],
+                                                  user_role['id'])
         self.assertEquals(resp['status'], '204')
 
     def test_remove_user_role_by_unauthorized_user(self):
         """Non admin user should not be authorized to remove a user's role"""
         (user, tenant, role) = self._get_role_params()
-        resp, user_role = self.client.assign_user_role(user['id'], role['id'],
-                                                      tenant['id'])
+        resp, user_role = self.client.assign_user_role(tenant['id'],
+                                                       user['id'],
+                                                       role['id'])
         self.assertRaises(exceptions.Unauthorized,
                          self.non_admin_client.remove_user_role,
-                         user['id'], role['id'])
+                         tenant['id'], user['id'], role['id'])
 
     def test_remove_user_role_request_without_token(self):
         """Request to remove a user's role without a valid token"""
         (user, tenant, role) = self._get_role_params()
-        resp, user_role = self.client.assign_user_role(user['id'], role['id'],
-                                                       tenant['id'])
+        resp, user_role = self.client.assign_user_role(tenant['id'],
+                                                       user['id'],
+                                                       role['id'])
         token = self.client.get_auth()
         self.client.delete_token(token)
         self.assertRaises(exceptions.Unauthorized,
-                         self.client.remove_user_role, user['id'], role['id'])
+                         self.client.remove_user_role, tenant['id'],
+                         user['id'], role['id'])
         self.client.clear_auth()
 
-    @unittest.skip("Until Bug 1022990 is fixed")
     def test_remove_user_role_non_existant_user(self):
         """Attempt to remove a role from a non existent user should fail"""
         (user, tenant, role) = self._get_role_params()
-        resp, user_role = self.client.assign_user_role(user['id'], role['id'],
-                                                      tenant['id'])
+        resp, user_role = self.client.assign_user_role(tenant['id'],
+                                                       user['id'],
+                                                       role['id'])
         self.assertRaises(exceptions.NotFound, self.client.remove_user_role,
-                         'junk-user-id-123', role['id'])
+                         tenant['id'], 'junk-user-id-123', role['id'])
 
-    @unittest.skip("Until Bug 1022990 is fixed")
     def test_remove_user_role_non_existant_role(self):
         """Attempt to delete a non existent role from a user should fail"""
         (user, tenant, role) = self._get_role_params()
-        resp, user_role = self.client.assign_user_role(user['id'], role['id'],
-                                                      tenant['id'])
+        resp, user_role = self.client.assign_user_role(tenant['id'],
+                                                       user['id'],
+                                                       role['id'])
         self.assertRaises(exceptions.NotFound, self.client.remove_user_role,
-                          user['id'], 'junk-user-role-123')
+                          tenant['id'], user['id'], 'junk-user-role-123')
+
+    def test_remove_user_role_non_existant_tenant(self):
+        """Attempt to remove a role from a non existent tenant should fail"""
+        (user, tenant, role) = self._get_role_params()
+        resp, user_role = self.client.assign_user_role(tenant['id'],
+                                                       user['id'],
+                                                       role['id'])
+        self.assertRaises(exceptions.NotFound, self.client.remove_user_role,
+                          'junk-tenant-id-123', user['id'], role['id'])
 
     def test_list_user_roles(self):
         """List roles assigned to a user on tenant"""
         (user, tenant, role) = self._get_role_params()
-        self.client.assign_user_role(user['id'], role['id'], tenant['id'])
-        resp, roles = self.client.list_user_roles(user['id'])
-        self.assertEquals(tenant['id'], roles[0]['tenantId'])
+        self.client.assign_user_role(tenant['id'], user['id'], role['id'])
+        resp, roles = self.client.list_user_roles(tenant['id'], user['id'])
+        self.assertEquals(1, len(roles))
+        self.assertEquals(role['id'], roles[0]['id'])
 
     def test_list_user_roles_by_unauthorized_user(self):
         """Non admin user should not be authorized to list a user's roles"""
         (user, tenant, role) = self._get_role_params()
-        self.client.assign_user_role(user['id'], role['id'], tenant['id'])
+        self.client.assign_user_role(tenant['id'], user['id'], role['id'])
         self.assertRaises(exceptions.Unauthorized,
-                          self.non_admin_client.list_user_roles, user['id'])
+                          self.non_admin_client.list_user_roles, tenant['id'],
+                          user['id'])
 
     def test_list_user_roles_request_without_token(self):
         """Request to list user's roles without a valid token should fail"""
@@ -223,10 +238,12 @@
         token = self.client.get_auth()
         self.client.delete_token(token)
         self.assertRaises(exceptions.Unauthorized,
-                          self.client.list_user_roles, user['id'])
+                          self.client.list_user_roles, tenant['id'],
+                          user['id'])
         self.client.clear_auth()
 
     def test_list_user_roles_for_non_existent_user(self):
         """Attempt to list roles of a non existent user should fail"""
+        (user, tenant, role) = self._get_role_params()
         self.assertRaises(exceptions.NotFound, self.client.list_user_roles,
-        'junk-role-aabbcc11')
+        tenant['id'], 'junk-role-aabbcc11')
