Class PluginTestUtils
java.lang.Object
com.atlassian.crowd.acceptance.tests.PluginTestUtils
This class provides utility methods for un/installing plugins in the Crowd acceptance tests.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringFetches the XSRF token from the UPM plugin collection resource.static FilegetPluginJar(Path pluginFolder, String pluginName) Returns the plugin jar file from the given plugin folder.static voidinstallPlugin(Path pluginFolder, String pluginFileName) Installs a plugin with the given plugin file/dependency name.static booleanisPluginEnabled(String pluginKey) Checks if the plugin with the given key is enabled.static voiduninstallPlugin(String pluginKey) Uninstalls a plugin with the given key.static booleanwaitUntilEnabled(String pluginKey, Duration timeout) Waits until the plugin with the given key is enabled.
-
Field Details
-
BASE_URL
-
PLUGINS_RESOURCE
- See Also:
-
-
Constructor Details
-
PluginTestUtils
public PluginTestUtils()
-
-
Method Details
-
installPlugin
Installs a plugin with the given plugin file/dependency name.- Parameters:
pluginFolder- the plugin folderpluginFileName- the plugin file name
-
uninstallPlugin
Uninstalls a plugin with the given key.- Parameters:
pluginKey-
-
fetchXsrfToken
Fetches the XSRF token from the UPM plugin collection resource.- Returns:
- the XSRF token
-
getPluginJar
Returns the plugin jar file from the given plugin folder.- Parameters:
pluginFolder- the plugin folderpluginName- the plugin name- Returns:
- the plugin jar file
-
waitUntilEnabled
Waits until the plugin with the given key is enabled. The method polls for the plugin status every second for 15 seconds.- Parameters:
pluginKey- the plugin keytimeout- the maximum time to wait- Returns:
- true if the plugin was enabled within given timeout, false otherwise
-
isPluginEnabled
Checks if the plugin with the given key is enabled.- Parameters:
pluginKey-- Returns:
- true if the plugin is enabled, false otherwise
-