use of com.google.gerrit.extensions.api.projects.CommentLinkInfo in project gerrit by GerritCodeReview.
the class ProjectIT method projectConfigUsesLocallySetCommentlinks.
@Test
public void projectConfigUsesLocallySetCommentlinks() throws Exception {
ConfigInput input = new ConfigInput();
addCommentLink(input, BUGZILLA, BUGZILLA_MATCH, BUGZILLA_LINK);
addCommentLink(input, JIRA, JIRA_MATCH, JIRA_LINK);
ConfigInfo info = setConfig(project, input);
Map<String, CommentLinkInfo> expected = new HashMap<>();
expected.put(BUGZILLA, commentLinkInfo(BUGZILLA, BUGZILLA_MATCH, BUGZILLA_LINK));
expected.put(JIRA, commentLinkInfo(JIRA, JIRA_MATCH, JIRA_LINK));
assertCommentLinks(info, expected);
assertCommentLinks(getConfig(), expected);
}
use of com.google.gerrit.extensions.api.projects.CommentLinkInfo in project gerrit by GerritCodeReview.
the class ProjectIT method removeCommentLink.
@Test
public void removeCommentLink() throws Exception {
ConfigInput input = new ConfigInput();
addCommentLink(input, BUGZILLA, BUGZILLA_MATCH, BUGZILLA_LINK);
addCommentLink(input, JIRA, JIRA_MATCH, JIRA_LINK);
ConfigInfo info = setConfig(project, input);
Map<String, CommentLinkInfo> expected = new HashMap<>();
expected.put(BUGZILLA, commentLinkInfo(BUGZILLA, BUGZILLA_MATCH, BUGZILLA_LINK));
expected.put(JIRA, commentLinkInfo(JIRA, JIRA_MATCH, JIRA_LINK));
assertCommentLinks(info, expected);
input = new ConfigInput();
addCommentLink(input, BUGZILLA, null);
setConfig(project, input);
expected = new HashMap<>();
expected.put(JIRA, commentLinkInfo(JIRA, JIRA_MATCH, JIRA_LINK));
assertCommentLinks(getConfig(project), expected);
}
use of com.google.gerrit.extensions.api.projects.CommentLinkInfo in project gerrit by GerritCodeReview.
the class ProjectIT method commentLinkInfo.
private CommentLinkInfo commentLinkInfo(String name, String match, String link) {
CommentLinkInfo info = new CommentLinkInfo();
info.name = name;
info.match = match;
info.link = link;
return info;
}
use of com.google.gerrit.extensions.api.projects.CommentLinkInfo in project gerrit by GerritCodeReview.
the class ProjectIT method projectConfigUsesCommentLinksFromGlobalAndLocal.
@Test
@GerritConfig(name = "commentlink.bugzilla.match", value = BUGZILLA_MATCH)
@GerritConfig(name = "commentlink.bugzilla.link", value = BUGZILLA_LINK)
public void projectConfigUsesCommentLinksFromGlobalAndLocal() throws Exception {
Map<String, CommentLinkInfo> expected = new HashMap<>();
expected.put(BUGZILLA, commentLinkInfo(BUGZILLA, BUGZILLA_MATCH, BUGZILLA_LINK));
assertCommentLinks(getConfig(), expected);
ConfigInput input = new ConfigInput();
addCommentLink(input, JIRA, JIRA_MATCH, JIRA_LINK);
ConfigInfo info = setConfig(project, input);
expected.put(JIRA, commentLinkInfo(JIRA, JIRA_MATCH, JIRA_LINK));
assertCommentLinks(info, expected);
assertCommentLinks(getConfig(), expected);
}
Aggregations