Class PluginTestUtils

java.lang.Object
com.atlassian.crowd.acceptance.tests.PluginTestUtils

public class PluginTestUtils extends Object
This class provides utility methods for un/installing plugins in the Crowd acceptance tests.
  • Field Details

  • Constructor Details

    • PluginTestUtils

      public PluginTestUtils()
  • Method Details

    • installPlugin

      public static void installPlugin(Path pluginFolder, String pluginFileName)
      Installs a plugin with the given plugin file/dependency name.
      Parameters:
      pluginFolder - the plugin folder
      pluginFileName - the plugin file name
    • uninstallPlugin

      public static void uninstallPlugin(String pluginKey)
      Uninstalls a plugin with the given key.
      Parameters:
      pluginKey -
    • fetchXsrfToken

      public static String fetchXsrfToken()
      Fetches the XSRF token from the UPM plugin collection resource.
      Returns:
      the XSRF token
    • getPluginJar

      public static File getPluginJar(@Nonnull Path pluginFolder, String pluginName)
      Returns the plugin jar file from the given plugin folder.
      Parameters:
      pluginFolder - the plugin folder
      pluginName - the plugin name
      Returns:
      the plugin jar file
    • waitUntilEnabled

      public static boolean waitUntilEnabled(String pluginKey, Duration timeout)
      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 key
      timeout - the maximum time to wait
      Returns:
      true if the plugin was enabled within given timeout, false otherwise
    • isPluginEnabled

      public static boolean isPluginEnabled(String pluginKey)
      Checks if the plugin with the given key is enabled.
      Parameters:
      pluginKey -
      Returns:
      true if the plugin is enabled, false otherwise