@Test public void JsonBuildSerialisationTest() throws JDOMException, IOException { ServerPaths serverPaths = mock(ServerPaths.class); SlackNotificationMainSettings myMainSettings = new SlackNotificationMainSettings(sBuildServer, serverPaths); framework = SlackNotificationMockingFrameworkImpl.create(BuildStateEnum.BUILD_FINISHED); framework.loadSlackNotificationProjectSettingsFromConfigXml(new File("../tcslackbuildnotifier-core/src/test/resources/project-settings-test-all-states-enabled-with-specific-builds.xml")); ProjectSlackNotificationsBean slacknotificationsConfig = ProjectSlackNotificationsBean.build(framework.getSlackNotificationProjectSettings() ,framework.getSBuildType() ,framework.getServer().getProjectManager().findProjectById("project01"), myMainSettings); System.out.println(ProjectSlackNotificationsBeanJsonSerialiser.serialise(slacknotificationsConfig)); }
public static ProjectSlackNotificationsBean build(SlackNotificationProjectSettings projSettings, SProject project, SlackNotificationMainSettings mainSettings){ ProjectSlackNotificationsBean bean = new ProjectSlackNotificationsBean(); List<SBuildType> projectBuildTypes = TeamCityIdResolver.getOwnBuildTypes(project); bean.projectId = TeamCityIdResolver.getInternalProjectId(project); bean.slackNotificationList = new LinkedHashMap<String, SlacknotificationConfigAndBuildTypeListHolder>(); SlackNotificationConfig newBlankConfig = new SlackNotificationConfig("", "", "", "", true, new BuildState().setAllEnabled(), true, true, null, true, true, true, true); newBlankConfig.setUniqueKey("new"); addSlackNotificationConfigHolder(bean, projectBuildTypes, newBlankConfig, mainSettings); for (SlackNotificationConfig config : projSettings.getSlackNotificationsAsList()){ addSlackNotificationConfigHolder(bean, projectBuildTypes, config, mainSettings); } return bean; }
ProjectSlackNotificationsBean { public static ProjectSlackNotificationsBean build(SlackNotificationProjectSettings projSettings, SProject project, SlackNotificationMainSettings mainSettings){ ProjectSlackNotificationsBean bean = new ProjectSlackNotificationsBean(); List<SBuildType> projectBuildTypes = TeamCityIdResolver.getOwnBuildTypes(project); bean.projectId = TeamCityIdResolver.getInternalProjectId(project); bean.slackNotificationList = new LinkedHashMap<String, SlacknotificationConfigAndBuildTypeListHolder>(); SlackNotificationConfig newBlankConfig = new SlackNotificationConfig("", "", "", "", true, new BuildState().setAllEnabled(), true, true, null, true, true, true, true); newBlankConfig.setUniqueKey("new"); addSlackNotificationConfigHolder(bean, projectBuildTypes, newBlankConfig, mainSettings); for (SlackNotificationConfig config : projSettings.getSlackNotificationsAsList()){ addSlackNotificationConfigHolder(bean, projectBuildTypes, config, mainSettings); } return bean; } }
ProjectSlackNotificationsBean { public static ProjectSlackNotificationsBean build(SlackNotificationProjectSettings projSettings, SProject project, SlackNotificationMainSettings mainSettings){ ProjectSlackNotificationsBean bean = new ProjectSlackNotificationsBean(); List<SBuildType> projectBuildTypes = TeamCityIdResolver.getOwnBuildTypes(project); bean.projectId = TeamCityIdResolver.getInternalProjectId(project); bean.slackNotificationList = new LinkedHashMap<String, SlacknotificationConfigAndBuildTypeListHolder>(); SlackNotificationConfig newBlankConfig = new SlackNotificationConfig("", "", "", "", true, new BuildState().setAllEnabled(), true, true, null, true, true, true, true); newBlankConfig.setUniqueKey("new"); addSlackNotificationConfigHolder(bean, projectBuildTypes, newBlankConfig, mainSettings); for (SlackNotificationConfig config : projSettings.getSlackNotificationsAsList()){ addSlackNotificationConfigHolder(bean, projectBuildTypes, config, mainSettings); } return bean; }  }
ProjectSlackNotificationsBean { public static ProjectSlackNotificationsBean build(SlackNotificationProjectSettings projSettings, SProject project, SlackNotificationMainSettings mainSettings){ ProjectSlackNotificationsBean bean = new ProjectSlackNotificationsBean(); List<SBuildType> projectBuildTypes = TeamCityIdResolver.getOwnBuildTypes(project); bean.projectId = TeamCityIdResolver.getInternalProjectId(project); bean.slackNotificationList = new LinkedHashMap<String, SlacknotificationConfigAndBuildTypeListHolder>(); SlackNotificationConfig newBlankConfig = new SlackNotificationConfig("", "", "", "", true, new BuildState().setAllEnabled(), true, true, null, true, true, true, true); newBlankConfig.setUniqueKey("new"); addSlackNotificationConfigHolder(bean, projectBuildTypes, newBlankConfig, mainSettings); for (SlackNotificationConfig config : projSettings.getSlackNotificationsAsList()){ addSlackNotificationConfigHolder(bean, projectBuildTypes, config, mainSettings); } return bean; }  static ProjectSlackNotificationsBean build(SlackNotificationProjectSettings projSettings, SProject project, SlackNotificationMainSettings mainSettings); static ProjectSlackNotificationsBean build(SlackNotificationProjectSettings projSettings, SBuildType sBuildType, SProject project, SlackNotificationMainSettings mainSettings); }
ProjectSlackNotificationsBean { public static ProjectSlackNotificationsBean build(SlackNotificationProjectSettings projSettings, SProject project, SlackNotificationMainSettings mainSettings){ ProjectSlackNotificationsBean bean = new ProjectSlackNotificationsBean(); List<SBuildType> projectBuildTypes = TeamCityIdResolver.getOwnBuildTypes(project); bean.projectId = TeamCityIdResolver.getInternalProjectId(project); bean.slackNotificationList = new LinkedHashMap<String, SlacknotificationConfigAndBuildTypeListHolder>(); SlackNotificationConfig newBlankConfig = new SlackNotificationConfig("", "", "", "", true, new BuildState().setAllEnabled(), true, true, null, true, true, true, true); newBlankConfig.setUniqueKey("new"); addSlackNotificationConfigHolder(bean, projectBuildTypes, newBlankConfig, mainSettings); for (SlackNotificationConfig config : projSettings.getSlackNotificationsAsList()){ addSlackNotificationConfigHolder(bean, projectBuildTypes, config, mainSettings); } return bean; }  static ProjectSlackNotificationsBean build(SlackNotificationProjectSettings projSettings, SProject project, SlackNotificationMainSettings mainSettings); static ProjectSlackNotificationsBean build(SlackNotificationProjectSettings projSettings, SBuildType sBuildType, SProject project, SlackNotificationMainSettings mainSettings);  }