use of com.google.gerrit.extensions.api.projects.DashboardInfo in project gerrit by GerritCodeReview.
the class DashboardsCollection method newDashboardInfo.
static DashboardInfo newDashboardInfo(String id) throws InvalidDashboardId {
DashboardInfo info = new DashboardInfo();
List<String> parts = Lists.newArrayList(Splitter.on(':').limit(2).split(id));
if (parts.size() != 2) {
throw new InvalidDashboardId(id);
}
info.id = id;
info.ref = parts.get(0);
info.path = parts.get(1);
return info;
}
use of com.google.gerrit.extensions.api.projects.DashboardInfo in project gerrit by GerritCodeReview.
the class DashboardIT method setDefaultDashboardByProject.
@Test
public void setDefaultDashboardByProject() throws Exception {
DashboardInfo info = createTestDashboard();
assertThat(info.isDefault).isNull();
project().defaultDashboard(info.id);
assertThat(project().dashboard(info.id).get().isDefault).isTrue();
assertThat(project().defaultDashboard().get().id).isEqualTo(info.id);
project().removeDefaultDashboard();
assertThat(project().dashboard(info.id).get().isDefault).isNull();
assertThrows(ResourceNotFoundException.class, () -> project().defaultDashboard().get());
}
use of com.google.gerrit.extensions.api.projects.DashboardInfo in project gerrit by GerritCodeReview.
the class DashboardIT method listDashboards.
@Test
public void listDashboards() throws Exception {
assertThat(dashboards()).isEmpty();
DashboardInfo info1 = createTestDashboard(DashboardsCollection.DEFAULT_DASHBOARD_NAME, "test1");
DashboardInfo info2 = createTestDashboard(DashboardsCollection.DEFAULT_DASHBOARD_NAME, "test2");
assertThat(dashboards().stream().map(d -> d.id).collect(toList())).containsExactly(info1.id, info2.id);
}
use of com.google.gerrit.extensions.api.projects.DashboardInfo in project gerrit by GerritCodeReview.
the class DashboardIT method newDashboardInfo.
private DashboardInfo newDashboardInfo(String ref, String path) {
DashboardInfo info = DashboardsCollection.newDashboardInfo(ref, path);
info.title = "Reviewer";
info.description = "Own review requests";
info.foreach = "owner:self";
DashboardSectionInfo section = new DashboardSectionInfo();
section.name = "Open";
section.query = "is:open";
info.sections = ImmutableList.of(section);
return info;
}
use of com.google.gerrit.extensions.api.projects.DashboardInfo in project gerrit by GerritCodeReview.
the class DashboardIT method getDashboard.
@Test
public void getDashboard() throws Exception {
DashboardInfo info = createTestDashboard();
DashboardInfo result = project().dashboard(info.id).get();
assertDashboardInfo(result, info);
}
Aggregations