use of com.google.gerrit.entities.StoredCommentLinkInfo in project gerrit by GerritCodeReview.
the class StoredCommentLinkInfoSerializerTest method overrideOnly_roundTrip.
@Test
public void overrideOnly_roundTrip() {
StoredCommentLinkInfo autoValue = StoredCommentLinkInfo.builder("name").setEnabled(true).setOverrideOnly(true).setLink("<p>html").setMatch("*").build();
assertThat(deserialize(serialize(autoValue))).isEqualTo(autoValue);
}
use of com.google.gerrit.entities.StoredCommentLinkInfo in project gerrit by GerritCodeReview.
the class ProjectConfigTest method readCommentLinksNoHtmlOrLinkAndMissingEnabled.
@Test
public void readCommentLinksNoHtmlOrLinkAndMissingEnabled() throws Exception {
RevCommit rev = tr.commit().add("project.config", "[commentlink \"bugzilla\"]\n \tlink = http://bugs.example.com/show_bug.cgi?id=$2" + "\n \tmatch = \"(bug\\\\s+#?)(\\\\d+)\"\n").create();
ProjectConfig cfg = read(rev);
assertThat(cfg.getCommentLinkSections()).containsExactly(StoredCommentLinkInfo.builder("bugzilla").setMatch("(bug\\s+#?)(\\d+)").setLink("http://bugs.example.com/show_bug.cgi?id=$2").build());
StoredCommentLinkInfo stored = Iterables.getOnlyElement(cfg.getCommentLinkSections());
assertThat(StoredCommentLinkInfo.fromInfo(stored.toInfo(), stored.getEnabled())).isEqualTo(stored);
}
Aggregations