def test_ensure_feature_is_enabled_called(self):
        set_module_args(dict(
            nitro_user='******',
            nitro_pass='******',
            nsip='192.0.2.1',
            state='present',
        ))
        from ansible_collections.misc.not_a_real_collection.plugins.modules import netscaler_gslb_service

        gslb_service_proxy_mock = Mock()
        ensure_feature_is_enabled_mock = Mock()
        client_mock = Mock()

        with patch.multiple(
            'ansible_collections.misc.not_a_real_collection.plugins.modules.netscaler_gslb_service',
            get_nitro_client=Mock(return_value=client_mock),
            gslb_service_exists=Mock(side_effect=[False, True]),
            gslb_service_identical=Mock(side_effect=[True]),
            nitro_exception=self.MockException,
            ensure_feature_is_enabled=ensure_feature_is_enabled_mock,
            monkey_patch_nitro_api=Mock(),
            ConfigProxy=Mock(return_value=gslb_service_proxy_mock),
        ):
            self.module = netscaler_gslb_service
            self.exited()
            ensure_feature_is_enabled_mock.assert_called_with(client_mock, 'GSLB')
    def test_ensure_feature_is_enabled_called(self):
        set_module_args(
            dict(
                nitro_user='******',
                nitro_pass='******',
                nsip='192.0.2.1',
                state='present',
                save_config=False,
            ))
        from ansible_collections.misc.not_a_real_collection.plugins.modules import netscaler_lb_monitor

        client_mock = Mock()

        lb_monitor_proxy_mock = Mock(diff_object=Mock(return_value={}))
        feature_mock = Mock()

        with patch.multiple(
                'ansible_collections.misc.not_a_real_collection.plugins.modules.netscaler_lb_monitor',
                get_nitro_client=Mock(return_value=client_mock),
                lbmonitor_exists=Mock(side_effect=[True, True]),
                lbmonitor_identical=Mock(side_effect=[True, True]),
                ConfigProxy=Mock(return_value=lb_monitor_proxy_mock),
                ensure_feature_is_enabled=feature_mock,
        ):
            self.module = netscaler_lb_monitor
            self.exited()
            feature_mock.assert_called_with(client_mock, 'LB')