@Test public void testGetEnabledListAsString() { assertTrue(slacknotificationAllEnabled.getEnabledListAsString().equals("All Build Events")); assertTrue(slacknotificationAllDisabled.getEnabledListAsString().equals("None")); assertTrue(slacknotificationMostEnabled.getEnabledListAsString().equals(" Build Started, Build Interrupted, Build Almost Completed, Build Failed, Build Successful")); }
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_STARTED)){ enabledStates += ", Build Started"; } 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 (enabledStates.length() > 0){ return enabledStates.substring(1); } else { return "None"; } } }
SlackNotificationConfig { 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_STARTED)){ enabledStates += ", Build Started"; } 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 (enabledStates.length() > 0){ return enabledStates.substring(1); } else { return "None"; } } } }
SlackNotificationConfig { 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_STARTED)){ enabledStates += ", Build Started"; } 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 (enabledStates.length() > 0){ return enabledStates.substring(1); } else { return "None"; } } } @SuppressWarnings("unchecked")  SlackNotificationConfig(Element e);  SlackNotificationConfig(String token,
								   String channel,
								   String teamName,
								   String filterBranchName,
								   Boolean enabled,
								   BuildState states,
								   boolean buildTypeAllEnabled,
								   boolean buildTypeSubProjects,
								   Set<String> enabledBuildTypes,
								   boolean mentionChannelEnabled,
								   boolean mentionSlackUserEnabled,
								   boolean mentionHereEnabled,
								   boolean mentionWhoTriggeredEnabled); }
SlackNotificationConfig { 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_STARTED)){ enabledStates += ", Build Started"; } 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 (enabledStates.length() > 0){ return enabledStates.substring(1); } else { return "None"; } } } @SuppressWarnings("unchecked")  SlackNotificationConfig(Element e);  SlackNotificationConfig(String token,
								   String channel,
								   String teamName,
								   String filterBranchName,
								   Boolean enabled,
								   BuildState states,
								   boolean buildTypeAllEnabled,
								   boolean buildTypeSubProjects,
								   Set<String> enabledBuildTypes,
								   boolean mentionChannelEnabled,
								   boolean mentionSlackUserEnabled,
								   boolean mentionHereEnabled,
								   boolean mentionWhoTriggeredEnabled); Element getAsElement(); boolean isEnabledForBuildType(SBuildType sBuildType); String getBuildTypeCountAsFriendlyString(); Boolean getEnabled(); void setEnabled(Boolean enabled); BuildState getBuildStates(); void setBuildStates(BuildState states); String getToken(); void setToken(String apiToken); String getChannel(); void setChannel(String channel); String getTeamName(); void setTeamName(String teamName); String getUniqueKey(); void setUniqueKey(String uniqueKey); String getEnabledListAsString(); String getSlackNotificationEnabledAsChecked(); String getStateAllAsChecked(); String getStateBuildStartedAsChecked(); String getStateBuildFinishedAsChecked(); String getStateBeforeFinishedAsChecked(); String getStateResponsibilityChangedAsChecked(); String getStateBuildInterruptedAsChecked(); String getStateBuildSuccessfulAsChecked(); String getStateBuildFixedAsChecked(); String getStateBuildFailedAsChecked(); String getStateBuildBrokenAsChecked(); Boolean isEnabledForAllBuildsInProject(); void enableForAllBuildsInProject(Boolean allBuildTypesEnabled); Boolean isEnabledForSubProjects(); void enableForSubProjects(Boolean subProjectsEnabled); void clearAllEnabledBuildsInProject(); void enableBuildInProject(String buildTypeId); void setMentionChannelEnabled(boolean mentionChannelEnabled); boolean getMentionChannelEnabled(); void setMentionSlackUserEnabled(boolean mentionSlackUserEnabled); boolean getMentionSlackUserEnabled(); void setMentionHereEnabled(boolean mentionHereEnabled); boolean getMentionHereEnabled(); boolean hasCustomContent(); void setHasCustomContent(boolean customContent); SlackNotificationContentConfig getContent(); void setContent(SlackNotificationContentConfig content); String getFilterBranchName(); void setFilterBranchName(String filterBranchName); boolean isMentionWhoTriggeredEnabled(); void setMentionWhoTriggeredEnabled(boolean mentionWhoTriggeredEnabled); }
SlackNotificationConfig { 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_STARTED)){ enabledStates += ", Build Started"; } 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 (enabledStates.length() > 0){ return enabledStates.substring(1); } else { return "None"; } } } @SuppressWarnings("unchecked")  SlackNotificationConfig(Element e);  SlackNotificationConfig(String token,
								   String channel,
								   String teamName,
								   String filterBranchName,
								   Boolean enabled,
								   BuildState states,
								   boolean buildTypeAllEnabled,
								   boolean buildTypeSubProjects,
								   Set<String> enabledBuildTypes,
								   boolean mentionChannelEnabled,
								   boolean mentionSlackUserEnabled,
								   boolean mentionHereEnabled,
								   boolean mentionWhoTriggeredEnabled); Element getAsElement(); boolean isEnabledForBuildType(SBuildType sBuildType); String getBuildTypeCountAsFriendlyString(); Boolean getEnabled(); void setEnabled(Boolean enabled); BuildState getBuildStates(); void setBuildStates(BuildState states); String getToken(); void setToken(String apiToken); String getChannel(); void setChannel(String channel); String getTeamName(); void setTeamName(String teamName); String getUniqueKey(); void setUniqueKey(String uniqueKey); String getEnabledListAsString(); String getSlackNotificationEnabledAsChecked(); String getStateAllAsChecked(); String getStateBuildStartedAsChecked(); String getStateBuildFinishedAsChecked(); String getStateBeforeFinishedAsChecked(); String getStateResponsibilityChangedAsChecked(); String getStateBuildInterruptedAsChecked(); String getStateBuildSuccessfulAsChecked(); String getStateBuildFixedAsChecked(); String getStateBuildFailedAsChecked(); String getStateBuildBrokenAsChecked(); Boolean isEnabledForAllBuildsInProject(); void enableForAllBuildsInProject(Boolean allBuildTypesEnabled); Boolean isEnabledForSubProjects(); void enableForSubProjects(Boolean subProjectsEnabled); void clearAllEnabledBuildsInProject(); void enableBuildInProject(String buildTypeId); void setMentionChannelEnabled(boolean mentionChannelEnabled); boolean getMentionChannelEnabled(); void setMentionSlackUserEnabled(boolean mentionSlackUserEnabled); boolean getMentionSlackUserEnabled(); void setMentionHereEnabled(boolean mentionHereEnabled); boolean getMentionHereEnabled(); boolean hasCustomContent(); void setHasCustomContent(boolean customContent); SlackNotificationContentConfig getContent(); void setContent(SlackNotificationContentConfig content); String getFilterBranchName(); void setFilterBranchName(String filterBranchName); boolean isMentionWhoTriggeredEnabled(); void setMentionWhoTriggeredEnabled(boolean mentionWhoTriggeredEnabled);  }