@Test public void testGetEnabledListAsString() { assertTrue(webhookAllEnabled.getEnabledListAsString().equals("All Build Events")); assertTrue(webhookAllDisabled.getEnabledListAsString().equals("None")); assertEquals(" Build Added to Queue, Build Removed from Queue by User, Build Started, Changes Loaded, Build Interrupted, Build Almost Completed, Build Failed, Build Successful, Build Pinned, Build Unpinned", webhookMostEnabled.getEnabledListAsString()); }
public String getEnabledListAsString(){ if (!this.enabled){ return "Disabled"; } else if (states.allEnabled()){ return "All Build Events"; } else if (states.noneEnabled()) { return "None"; } else { String enabledStates = ""; if (states.enabled(BuildStateEnum.BUILD_ADDED_TO_QUEUE)){ enabledStates += ", Build Added to Queue"; } if (states.enabled(BuildStateEnum.BUILD_REMOVED_FROM_QUEUE)){ enabledStates += ", Build Removed from Queue by User"; } if (states.enabled(BuildStateEnum.BUILD_STARTED)){ enabledStates += ", Build Started"; } if (states.enabled(BuildStateEnum.CHANGES_LOADED)){ enabledStates += ", Changes Loaded"; } if (states.enabled(BuildStateEnum.BUILD_INTERRUPTED)){ enabledStates += ", Build Interrupted"; } if (states.enabled(BuildStateEnum.BEFORE_BUILD_FINISHED)){ enabledStates += ", Build Almost Completed"; } if (states.enabled(BuildStateEnum.RESPONSIBILITY_CHANGED)){ enabledStates += ", Build Responsibility Changed"; } if (states.enabled(BuildStateEnum.BUILD_FAILED)){ if (states.enabled(BuildStateEnum.BUILD_BROKEN)){ enabledStates += ", Build Broken"; } else { enabledStates += ", Build Failed"; } } if (states.enabled(BuildStateEnum.BUILD_SUCCESSFUL)){ if (states.enabled(BuildStateEnum.BUILD_FIXED)){ enabledStates += ", Build Fixed"; } else { enabledStates += ", Build Successful"; } } if (states.enabled(BuildStateEnum.BUILD_PINNED)){ enabledStates += ", Build Pinned"; } if (states.enabled(BuildStateEnum.BUILD_UNPINNED)){ enabledStates += ", Build Unpinned"; } if (enabledStates.length() > 0){ return enabledStates.substring(1); } else { return "None"; } } }
WebHookConfig { public String getEnabledListAsString(){ if (!this.enabled){ return "Disabled"; } else if (states.allEnabled()){ return "All Build Events"; } else if (states.noneEnabled()) { return "None"; } else { String enabledStates = ""; if (states.enabled(BuildStateEnum.BUILD_ADDED_TO_QUEUE)){ enabledStates += ", Build Added to Queue"; } if (states.enabled(BuildStateEnum.BUILD_REMOVED_FROM_QUEUE)){ enabledStates += ", Build Removed from Queue by User"; } if (states.enabled(BuildStateEnum.BUILD_STARTED)){ enabledStates += ", Build Started"; } if (states.enabled(BuildStateEnum.CHANGES_LOADED)){ enabledStates += ", Changes Loaded"; } if (states.enabled(BuildStateEnum.BUILD_INTERRUPTED)){ enabledStates += ", Build Interrupted"; } if (states.enabled(BuildStateEnum.BEFORE_BUILD_FINISHED)){ enabledStates += ", Build Almost Completed"; } if (states.enabled(BuildStateEnum.RESPONSIBILITY_CHANGED)){ enabledStates += ", Build Responsibility Changed"; } if (states.enabled(BuildStateEnum.BUILD_FAILED)){ if (states.enabled(BuildStateEnum.BUILD_BROKEN)){ enabledStates += ", Build Broken"; } else { enabledStates += ", Build Failed"; } } if (states.enabled(BuildStateEnum.BUILD_SUCCESSFUL)){ if (states.enabled(BuildStateEnum.BUILD_FIXED)){ enabledStates += ", Build Fixed"; } else { enabledStates += ", Build Successful"; } } if (states.enabled(BuildStateEnum.BUILD_PINNED)){ enabledStates += ", Build Pinned"; } if (states.enabled(BuildStateEnum.BUILD_UNPINNED)){ enabledStates += ", Build Unpinned"; } if (enabledStates.length() > 0){ return enabledStates.substring(1); } else { return "None"; } } } }
WebHookConfig { public String getEnabledListAsString(){ if (!this.enabled){ return "Disabled"; } else if (states.allEnabled()){ return "All Build Events"; } else if (states.noneEnabled()) { return "None"; } else { String enabledStates = ""; if (states.enabled(BuildStateEnum.BUILD_ADDED_TO_QUEUE)){ enabledStates += ", Build Added to Queue"; } if (states.enabled(BuildStateEnum.BUILD_REMOVED_FROM_QUEUE)){ enabledStates += ", Build Removed from Queue by User"; } if (states.enabled(BuildStateEnum.BUILD_STARTED)){ enabledStates += ", Build Started"; } if (states.enabled(BuildStateEnum.CHANGES_LOADED)){ enabledStates += ", Changes Loaded"; } if (states.enabled(BuildStateEnum.BUILD_INTERRUPTED)){ enabledStates += ", Build Interrupted"; } if (states.enabled(BuildStateEnum.BEFORE_BUILD_FINISHED)){ enabledStates += ", Build Almost Completed"; } if (states.enabled(BuildStateEnum.RESPONSIBILITY_CHANGED)){ enabledStates += ", Build Responsibility Changed"; } if (states.enabled(BuildStateEnum.BUILD_FAILED)){ if (states.enabled(BuildStateEnum.BUILD_BROKEN)){ enabledStates += ", Build Broken"; } else { enabledStates += ", Build Failed"; } } if (states.enabled(BuildStateEnum.BUILD_SUCCESSFUL)){ if (states.enabled(BuildStateEnum.BUILD_FIXED)){ enabledStates += ", Build Fixed"; } else { enabledStates += ", Build Successful"; } } if (states.enabled(BuildStateEnum.BUILD_PINNED)){ enabledStates += ", Build Pinned"; } if (states.enabled(BuildStateEnum.BUILD_UNPINNED)){ enabledStates += ", Build Unpinned"; } if (enabledStates.length() > 0){ return enabledStates.substring(1); } else { return "None"; } } } @SuppressWarnings("unchecked")  WebHookConfig(Element e);  WebHookConfig(String projectInternalId, String projectExternalId, String url, Boolean enabled, BuildState states, String payloadTemplate, boolean buildTypeAllEnabled, boolean buildTypeSubProjects, Set<String> enabledBuildTypes, WebHookAuthConfig webHookAuthConfig); }
WebHookConfig { public String getEnabledListAsString(){ if (!this.enabled){ return "Disabled"; } else if (states.allEnabled()){ return "All Build Events"; } else if (states.noneEnabled()) { return "None"; } else { String enabledStates = ""; if (states.enabled(BuildStateEnum.BUILD_ADDED_TO_QUEUE)){ enabledStates += ", Build Added to Queue"; } if (states.enabled(BuildStateEnum.BUILD_REMOVED_FROM_QUEUE)){ enabledStates += ", Build Removed from Queue by User"; } if (states.enabled(BuildStateEnum.BUILD_STARTED)){ enabledStates += ", Build Started"; } if (states.enabled(BuildStateEnum.CHANGES_LOADED)){ enabledStates += ", Changes Loaded"; } if (states.enabled(BuildStateEnum.BUILD_INTERRUPTED)){ enabledStates += ", Build Interrupted"; } if (states.enabled(BuildStateEnum.BEFORE_BUILD_FINISHED)){ enabledStates += ", Build Almost Completed"; } if (states.enabled(BuildStateEnum.RESPONSIBILITY_CHANGED)){ enabledStates += ", Build Responsibility Changed"; } if (states.enabled(BuildStateEnum.BUILD_FAILED)){ if (states.enabled(BuildStateEnum.BUILD_BROKEN)){ enabledStates += ", Build Broken"; } else { enabledStates += ", Build Failed"; } } if (states.enabled(BuildStateEnum.BUILD_SUCCESSFUL)){ if (states.enabled(BuildStateEnum.BUILD_FIXED)){ enabledStates += ", Build Fixed"; } else { enabledStates += ", Build Successful"; } } if (states.enabled(BuildStateEnum.BUILD_PINNED)){ enabledStates += ", Build Pinned"; } if (states.enabled(BuildStateEnum.BUILD_UNPINNED)){ enabledStates += ", Build Unpinned"; } if (enabledStates.length() > 0){ return enabledStates.substring(1); } else { return "None"; } } } @SuppressWarnings("unchecked")  WebHookConfig(Element e);  WebHookConfig(String projectInternalId, String projectExternalId, String url, Boolean enabled, BuildState states, String payloadTemplate, boolean buildTypeAllEnabled, boolean buildTypeSubProjects, Set<String> enabledBuildTypes, WebHookAuthConfig webHookAuthConfig); Element getAsElement(); SortedMap<String,String> getParams(); boolean isEnabledForBuildType(SBuildType sBuildType); boolean isSpecificBuildTypeEnabled(SBuildType sBuildType); Set<String> getEnabledBuildTypesSet(); Boolean getEnabled(); void setEnabled(Boolean enabled); BuildState getBuildStates(); void setBuildStates(BuildState states); String getUrl(); void setUrl(String url); String getUniqueKey(); void setUniqueKey(String uniqueKey); String getEnabledListAsString(); String getWebHookEnabledAsChecked(); String getStateAllAsChecked(); String getStateBuildStartedAsChecked(); String getStateChangesLoadedAsChecked(); String getStateBuildFinishedAsChecked(); String getStateBeforeFinishedAsChecked(); String getStateResponsibilityChangedAsChecked(); String getStateBuildInterruptedAsChecked(); String getStateBuildSuccessfulAsChecked(); String getStateBuildFixedAsChecked(); String getStateBuildFailedAsChecked(); String getStateBuildBrokenAsChecked(); String getPayloadTemplate(); void setPayloadFormat(String payloadFormat); void setPayloadTemplate(String payloadTemplate); Boolean isEnabledForAllBuildsInProject(); void enableForAllBuildsInProject(Boolean allBuildTypesEnabled); Boolean isEnabledForSubProjects(); void enableForSubProjects(Boolean subProjectsEnabled); void clearAllEnabledBuildsInProject(); void enableBuildInProject(String buildTypeId); Map<String,String> getEnabledTemplates(); Boolean getAuthEnabled(); void setAuthEnabled(Boolean authEnabled); void setAuthParameters(Map<String, String> authParameters); void clearAuthParameters(); void setAuthType(String authType); void setAuthPreemptive(Boolean authPreemptive); WebHookAuthConfig getAuthenticationConfig(); List<WebHookFilterConfig> getTriggerFilters(); List<WebHookHeaderConfig> getHeaders(); void setHeaders(List<WebHookHeaderConfig> headers); WebHookConfig copy(); String getProjectInternalId(); void setProjectInternalId(String projectInternalId); String getProjectExternalId(); void setProjectExternalId(String projectExternalId); }
WebHookConfig { public String getEnabledListAsString(){ if (!this.enabled){ return "Disabled"; } else if (states.allEnabled()){ return "All Build Events"; } else if (states.noneEnabled()) { return "None"; } else { String enabledStates = ""; if (states.enabled(BuildStateEnum.BUILD_ADDED_TO_QUEUE)){ enabledStates += ", Build Added to Queue"; } if (states.enabled(BuildStateEnum.BUILD_REMOVED_FROM_QUEUE)){ enabledStates += ", Build Removed from Queue by User"; } if (states.enabled(BuildStateEnum.BUILD_STARTED)){ enabledStates += ", Build Started"; } if (states.enabled(BuildStateEnum.CHANGES_LOADED)){ enabledStates += ", Changes Loaded"; } if (states.enabled(BuildStateEnum.BUILD_INTERRUPTED)){ enabledStates += ", Build Interrupted"; } if (states.enabled(BuildStateEnum.BEFORE_BUILD_FINISHED)){ enabledStates += ", Build Almost Completed"; } if (states.enabled(BuildStateEnum.RESPONSIBILITY_CHANGED)){ enabledStates += ", Build Responsibility Changed"; } if (states.enabled(BuildStateEnum.BUILD_FAILED)){ if (states.enabled(BuildStateEnum.BUILD_BROKEN)){ enabledStates += ", Build Broken"; } else { enabledStates += ", Build Failed"; } } if (states.enabled(BuildStateEnum.BUILD_SUCCESSFUL)){ if (states.enabled(BuildStateEnum.BUILD_FIXED)){ enabledStates += ", Build Fixed"; } else { enabledStates += ", Build Successful"; } } if (states.enabled(BuildStateEnum.BUILD_PINNED)){ enabledStates += ", Build Pinned"; } if (states.enabled(BuildStateEnum.BUILD_UNPINNED)){ enabledStates += ", Build Unpinned"; } if (enabledStates.length() > 0){ return enabledStates.substring(1); } else { return "None"; } } } @SuppressWarnings("unchecked")  WebHookConfig(Element e);  WebHookConfig(String projectInternalId, String projectExternalId, String url, Boolean enabled, BuildState states, String payloadTemplate, boolean buildTypeAllEnabled, boolean buildTypeSubProjects, Set<String> enabledBuildTypes, WebHookAuthConfig webHookAuthConfig); Element getAsElement(); SortedMap<String,String> getParams(); boolean isEnabledForBuildType(SBuildType sBuildType); boolean isSpecificBuildTypeEnabled(SBuildType sBuildType); Set<String> getEnabledBuildTypesSet(); Boolean getEnabled(); void setEnabled(Boolean enabled); BuildState getBuildStates(); void setBuildStates(BuildState states); String getUrl(); void setUrl(String url); String getUniqueKey(); void setUniqueKey(String uniqueKey); String getEnabledListAsString(); String getWebHookEnabledAsChecked(); String getStateAllAsChecked(); String getStateBuildStartedAsChecked(); String getStateChangesLoadedAsChecked(); String getStateBuildFinishedAsChecked(); String getStateBeforeFinishedAsChecked(); String getStateResponsibilityChangedAsChecked(); String getStateBuildInterruptedAsChecked(); String getStateBuildSuccessfulAsChecked(); String getStateBuildFixedAsChecked(); String getStateBuildFailedAsChecked(); String getStateBuildBrokenAsChecked(); String getPayloadTemplate(); void setPayloadFormat(String payloadFormat); void setPayloadTemplate(String payloadTemplate); Boolean isEnabledForAllBuildsInProject(); void enableForAllBuildsInProject(Boolean allBuildTypesEnabled); Boolean isEnabledForSubProjects(); void enableForSubProjects(Boolean subProjectsEnabled); void clearAllEnabledBuildsInProject(); void enableBuildInProject(String buildTypeId); Map<String,String> getEnabledTemplates(); Boolean getAuthEnabled(); void setAuthEnabled(Boolean authEnabled); void setAuthParameters(Map<String, String> authParameters); void clearAuthParameters(); void setAuthType(String authType); void setAuthPreemptive(Boolean authPreemptive); WebHookAuthConfig getAuthenticationConfig(); List<WebHookFilterConfig> getTriggerFilters(); List<WebHookHeaderConfig> getHeaders(); void setHeaders(List<WebHookHeaderConfig> headers); WebHookConfig copy(); String getProjectInternalId(); void setProjectInternalId(String projectInternalId); String getProjectExternalId(); void setProjectExternalId(String projectExternalId);  }