use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class CreateLabelIT method createWithCopyAllScoresIfListOfFilesDidNotChange.
@Test
public void createWithCopyAllScoresIfListOfFilesDidNotChange() throws Exception {
LabelDefinitionInput input = new LabelDefinitionInput();
input.values = ImmutableMap.of("+1", "Looks Good", " 0", "Don't Know", "-1", "Looks Bad");
input.copyAllScoresIfListOfFilesDidNotChange = true;
LabelDefinitionInfo createdLabel = gApi.projects().name(project.get()).label("foo").create(input).get();
assertThat(createdLabel.copyAllScoresIfListOfFilesDidNotChange).isTrue();
}
use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class CreateLabelIT method createWithoutCopyAllScoresOnMergeFirstParentUpdate.
@Test
public void createWithoutCopyAllScoresOnMergeFirstParentUpdate() throws Exception {
LabelDefinitionInput input = new LabelDefinitionInput();
input.values = ImmutableMap.of("+1", "Looks Good", " 0", "Don't Know", "-1", "Looks Bad");
input.copyAllScoresOnMergeFirstParentUpdate = false;
LabelDefinitionInfo createdLabel = gApi.projects().name(project.get()).label("foo").create(input).get();
assertThat(createdLabel.copyAllScoresOnMergeFirstParentUpdate).isNull();
}
use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class CreateLabelIT method createWithCopyMinScore.
@Test
public void createWithCopyMinScore() throws Exception {
LabelDefinitionInput input = new LabelDefinitionInput();
input.values = ImmutableMap.of("+1", "Looks Good", " 0", "Don't Know", "-1", "Looks Bad");
input.copyMinScore = true;
LabelDefinitionInfo createdLabel = gApi.projects().name(project.get()).label("foo").create(input).get();
assertThat(createdLabel.copyMinScore).isTrue();
}
use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class CreateLabelIT method createWithoutCopyMaxScore.
@Test
public void createWithoutCopyMaxScore() throws Exception {
LabelDefinitionInput input = new LabelDefinitionInput();
input.values = ImmutableMap.of("+1", "Looks Good", " 0", "Don't Know", "-1", "Looks Bad");
input.copyMaxScore = false;
LabelDefinitionInfo createdLabel = gApi.projects().name(project.get()).label("foo").create(input).get();
assertThat(createdLabel.copyMaxScore).isNull();
}
use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class CreateLabelIT method createWithBranches.
@Test
public void createWithBranches() throws Exception {
LabelDefinitionInput input = new LabelDefinitionInput();
input.values = ImmutableMap.of("+1", "Looks Good", " 0", "Don't Know", "-1", "Looks Bad");
// Branches can be full ref, ref pattern or regular expression.
input.branches = ImmutableList.of("refs/heads/master", "refs/heads/foo/*", "^refs/heads/stable-.*");
LabelDefinitionInfo createdLabel = gApi.projects().name(project.get()).label("Foo").create(input).get();
assertThat(createdLabel.branches).containsExactlyElementsIn(input.branches);
}
Aggregations