Class DefensicsUtils


  • public class DefensicsUtils
    extends Object
    • Constructor Detail

      • DefensicsUtils

        public DefensicsUtils()
    • Method Detail

      • countRunFailures

        public static int countRunFailures​(Run run)
        Counts the total number of failures for a run from FailureSummaryEntry objects.
        Parameters:
        run - Defensics run object
        Returns:
        total count of all failures in the run
      • createUserAgentString

        public String createUserAgentString()
        Creates User-agent header value, e.g. Defensics-Jenkins-Plugin/1.2.3. or if version information was not available, only product name, e.g. Defensics-Jenkins-Plugin.
        Returns:
        User-agent header value.
      • getPluginVersion

        public Optional<String> getPluginVersion​(String pluginName)
        Gets plugin's version.
        Parameters:
        pluginName - Short name of the plugin
        Returns:
        Version information wrapped in Optional, or empty optional if version was not available