async def test_mediation_request_grant_role_server(self):
    self.mock_record.role = MediationRecord.ROLE_SERVER
    with async_mock.patch.object(test_module.MediationRecord, 'retrieve_by_id', async_mock.CoroutineMock(return_value=self.mock_record)) as mock_mediation_record_retrieve, async_mock.patch.object(test_module.web, 'json_response') as mock_response:
        (await test_module.mediation_request_grant(self.request))
        mock_response.assert_called_once_with(self.mock_record.serialize.return_value, status=201)
        self.outbound_message_router.assert_called()
async def test_mediation_request_grant_role_server(self):
    self.mock_record.role = MediationRecord.ROLE_SERVER
    with async_mock.patch.object(test_module.MediationRecord, 'retrieve_by_id', async_mock.CoroutineMock(return_value=self.mock_record)) as mock_mediation_record_retrieve, async_mock.patch.object(test_module.web, 'json_response') as mock_response:
        (await test_module.mediation_request_grant(self.request))
        mock_response.assert_called_once_with(self.mock_record.serialize.return_value, status=201)
        self.outbound_message_router.assert_called()