moduleExternalAuthorizationServiceHelpersdefenable_external_authorization_service_checkstub_application_setting(external_authorization_service_enabled: true)stub_application_setting(external_authorization_service_url: 'https://authorize.me')stub_application_setting(external_authorization_service_default_label: 'default_label')stub_request(:post,"https://authorize.me").to_return(status: 200)enddefexternal_service_set_access(allowed,user,project)enable_external_authorization_service_checkclassification_label=::Gitlab::CurrentSettings.current_application_settings.external_authorization_service_default_label# Reload the project so cached licensed features are reloadedifprojectclassification_label=Project.find(project.id).external_authorization_classification_labelendallow(::Gitlab::ExternalAuthorization).toreceive(:access_allowed?).with(user,classification_label,any_args).and_return(allowed)enddefexternal_service_allow_access(user,project=nil)external_service_set_access(true,user,project)enddefexternal_service_deny_access(user,project=nil)external_service_set_access(false,user,project)endend