diff --git a/awx_collection/test/awx/test_notification.py b/awx_collection/test/awx/test_notification.py index 33ea3cd488..f06b83b79e 100644 --- a/awx_collection/test/awx/test_notification.py +++ b/awx_collection/test/awx/test_notification.py @@ -82,3 +82,31 @@ def test_invalid_notification_configuration(run_module, admin_user, organization ), admin_user) assert result.get('failed', False), result.get('msg', result) assert 'Missing required fields for Notification Configuration' in result['msg'] + + +@pytest.mark.django_db +@pytest.mark.xfail(reason='Handling API validation changes w.r.t. changed status is an open item') +def test_deprecated_to_modern_no_op(run_module, admin_user, organization): + nt_config = { + 'url': 'http://www.example.com/hook', + 'headers': { + 'X-Custom-Header': 'value123' + } + } + result = run_module('tower_notification', dict( + name='foo-notification-template', + organization=organization.name, + notification_type='webhook', + notification_configuration=nt_config, + ), admin_user) + assert not result.get('failed', False), result.get('msg', result) + assert result.pop('changed', None), result + + result = run_module('tower_notification', dict( + name='foo-notification-template', + organization=organization.name, + notification_type='webhook', + notification_configuration=nt_config, + ), admin_user) + assert not result.get('failed', False), result.get('msg', result) + assert not result.pop('changed', None), result diff --git a/awx_collection/tests/integration/targets/tower_notification/tasks/main.yml b/awx_collection/tests/integration/targets/tower_notification/tasks/main.yml index 8ab933e8cb..03025e4b6a 100644 --- a/awx_collection/tests/integration/targets/tower_notification/tasks/main.yml +++ b/awx_collection/tests/integration/targets/tower_notification/tasks/main.yml @@ -114,22 +114,6 @@ that: - result is changed -- name: Recreate with notification_configuration - tower_notification: - name: "{{ webhook_not }}" - organization: Default - notification_type: webhook - notification_configuration: - url: http://www.example.com/hook - headers: - X-Custom-Header: value123 - state: present - register: result - -- assert: - that: - - result is not changed - - name: Delete webhook notification tower_notification: name: "{{ webhook_not }}"