Package com.atlassian.jira.mock
Class MockFeatureManager
java.lang.Object
com.atlassian.jira.mock.MockFeatureManager
- All Implemented Interfaces:
FeatureManager
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface com.atlassian.jira.config.FeatureManager
SYSTEM_PROPERTY_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactivateFeatureFlag(FeatureFlag featureFlag) deactivateFeatureFlag(FeatureFlag featureFlag) Deprecated.disableFeature(CoreFeatures feature) disableFeature(Feature feature) disableFeature(FeatureFlag feature) voiddisableSiteDarkFeature(String feature) Disables a site-wide feature.voiddisableUserDarkFeature(ApplicationUser user, String feature) Disables a feature for a particular user.voidenable(CoreFeatures feature) Deprecated.UseenableFeature(CoreFeatures)insteadvoidDeprecated.UseenableFeature(Feature)insteadenableFeature(CoreFeatures feature) enableFeature(Feature feature) enableFeature(FeatureFlag feature) voidenableSiteDarkFeature(String feature) Enables a site-wide feature.voidenableUserDarkFeature(ApplicationUser user, String feature) Enables a feature for a particular User.CreatesDarkFeaturesinstances from the PropertySet associated with the current user.Returns a set containing the feature keys of all features that are currently enabled.io.atlassian.fugue.Option<FeatureFlag> getFeatureFlag(String featureKey) Return a feature flag by keybooleanReturns true if the currently logged in user has permission to edit site dark features.booleanisEnabled(CoreFeatures feature) Checks whetherfeatureis enabled either in the running JIRA instance or for the current user.booleanChecks whether or not the specified feature is enabled.booleanisEnabled(FeatureFlag featureFlag) Checking the state of feature flagbooleanChecks whether featurefeatureKeyis enabled either in the running JIRA instance or for the current user.booleanisEnabledForUser(ApplicationUser user, String featureKey) Checks whether a feature with given featureKey is enabled in the running JIRA instance for the given user.registerFeatureFlag(FeatureFlag feature) resetFeature(FeatureFlag feature) setFeatureEnabled(FeatureFlag feature, boolean enabled) unregisterFeatureFlag(FeatureFlag feature)
-
Constructor Details
-
MockFeatureManager
public MockFeatureManager()
-
-
Method Details
-
isEnabled
Description copied from interface:FeatureManagerChecks whether featurefeatureKeyis enabled either in the running JIRA instance or for the current user. If the featureKey relates to a feature flag that is defined, then it will also take the default values into consideration.- Specified by:
isEnabledin interfaceFeatureManager- Parameters:
featureKey- feature key- Returns:
true, if feature identified by featureKey is enabled,falseotherwise
-
isEnabled
Description copied from interface:FeatureManagerChecks whether or not the specified feature is enabled. This method should be prefered overFeatureManager.isEnabled(String)for internal feature checks, particularly for core features that are not user-settable, as it will skip loading the current user's preferences when possible.- Specified by:
isEnabledin interfaceFeatureManager- Parameters:
feature- the feature to check- Returns:
trueiffeatureis enabled;falseotherwise
-
isEnabled
Description copied from interface:FeatureManagerChecking the state of feature flag- Specified by:
isEnabledin interfaceFeatureManager- Parameters:
featureFlag- defined feature flag- Returns:
- state of the feature flag
-
getFeatureFlag
Description copied from interface:FeatureManagerReturn a feature flag by key- Specified by:
getFeatureFlagin interfaceFeatureManager- Parameters:
featureKey- the feature key string- Returns:
- optional value of feature flag
-
isEnabled
Description copied from interface:FeatureManagerChecks whetherfeatureis enabled either in the running JIRA instance or for the current user. This method should be prefered overFeatureManager.isEnabled(String)for internal feature checks, particularly for core features that are not user-settable, as it will skip loading the current user's preferences when possible.- Specified by:
isEnabledin interfaceFeatureManager- Parameters:
feature- the core feature to check- Returns:
trueiffeatureis enabled;falseotherwise
-
enable
Deprecated.UseenableFeature(CoreFeatures)instead -
enableFeature
-
disableFeature
-
enable
Deprecated.UseenableFeature(Feature)instead -
enableFeature
-
disable
Deprecated.UsedisableFeature(Feature)instead -
disableFeature
-
enableFeature
-
disableFeature
-
setFeatureEnabled
-
resetFeature
-
registerFeatureFlag
-
unregisterFeatureFlag
-
activateFeatureFlag
-
deactivateFeatureFlag
-
getEnabledFeatureKeys
Description copied from interface:FeatureManagerReturns a set containing the feature keys of all features that are currently enabled.- Specified by:
getEnabledFeatureKeysin interfaceFeatureManager- Returns:
- a set containing the feature keys of all features that are currently enabled
-
getDarkFeatures
Description copied from interface:FeatureManagerCreatesDarkFeaturesinstances from the PropertySet associated with the current user.- Specified by:
getDarkFeaturesin interfaceFeatureManager- Returns:
- Returns the Dark Features state for the current user.
-
getRegisteredFlags
- Specified by:
getRegisteredFlagsin interfaceFeatureManager- Returns:
- a list of feature flags in the system
-
enableUserDarkFeature
Description copied from interface:FeatureManagerEnables a feature for a particular User. Raises aFeatureEnabledEvent.Since JIRA 5.1, this method raises a
FeatureEnabledEventif it is successful.- Specified by:
enableUserDarkFeaturein interfaceFeatureManager- Parameters:
user- the user to enable the feature forfeature- the feature to enable
-
disableUserDarkFeature
Description copied from interface:FeatureManagerDisables a feature for a particular user.Since JIRA 5.1, this method raises a
FeatureDisabledEventif it is successful.- Specified by:
disableUserDarkFeaturein interfaceFeatureManager- Parameters:
user- the user to disable the feature forfeature- the feature to disable
-
enableSiteDarkFeature
Description copied from interface:FeatureManagerEnables a site-wide feature.Since JIRA 5.1, this method raises a
FeatureEnabledEventif it is successful.- Specified by:
enableSiteDarkFeaturein interfaceFeatureManager- Parameters:
feature- the feature to enable
-
disableSiteDarkFeature
Description copied from interface:FeatureManagerDisables a site-wide feature.Since JIRA 5.1, this method raises a
FeatureDisabledEventif it is successful.- Specified by:
disableSiteDarkFeaturein interfaceFeatureManager- Parameters:
feature- the feature to disable
-
hasSiteEditPermission
public boolean hasSiteEditPermission()Description copied from interface:FeatureManagerReturns true if the currently logged in user has permission to edit site dark features.- Specified by:
hasSiteEditPermissionin interfaceFeatureManager- Returns:
- true if the currently logged in user has permission to edit site dark features.
-
getDarkFeaturesForUser
- Specified by:
getDarkFeaturesForUserin interfaceFeatureManager- Parameters:
user- the user being queried;nullrepresents the anonymous user- Returns:
- Returns the dark features state for the current user.
-
isEnabledForUser
Description copied from interface:FeatureManagerChecks whether a feature with given featureKey is enabled in the running JIRA instance for the given user.- Specified by:
isEnabledForUserin interfaceFeatureManager- Parameters:
user- the user being queriedfeatureKey- feature key- Returns:
true, if feature identified by featureKey is enabled,falseotherwise
-
disableFeature(Feature)instead