use of com.google.gerrit.extensions.common.LabelDefinitionInput in project gerrit by GerritCodeReview.
the class CreateLabelIT method createWithoutCopyAllScoresIfNoCodeChange.
@Test
public void createWithoutCopyAllScoresIfNoCodeChange() throws Exception {
LabelDefinitionInput input = new LabelDefinitionInput();
input.values = ImmutableMap.of("+1", "Looks Good", " 0", "Don't Know", "-1", "Looks Bad");
input.copyAllScoresIfNoCodeChange = false;
LabelDefinitionInfo createdLabel = gApi.projects().name(project.get()).label("foo").create(input).get();
assertThat(createdLabel.copyAllScoresIfNoCodeChange).isNull();
}
use of com.google.gerrit.extensions.common.LabelDefinitionInput in project gerrit by GerritCodeReview.
the class CreateLabelIT method createWithoutCanOverride.
@Test
public void createWithoutCanOverride() throws Exception {
LabelDefinitionInput input = new LabelDefinitionInput();
input.values = ImmutableMap.of("+1", "Looks Good", " 0", "Don't Know", "-1", "Looks Bad");
input.canOverride = false;
LabelDefinitionInfo createdLabel = gApi.projects().name(project.get()).label("foo").create(input).get();
assertThat(createdLabel.canOverride).isNull();
}
use of com.google.gerrit.extensions.common.LabelDefinitionInput in project gerrit by GerritCodeReview.
the class CreateLabelIT method createWithCanOverride.
@Test
public void createWithCanOverride() throws Exception {
LabelDefinitionInput input = new LabelDefinitionInput();
input.values = ImmutableMap.of("+1", "Looks Good", " 0", "Don't Know", "-1", "Looks Bad");
input.canOverride = true;
LabelDefinitionInfo createdLabel = gApi.projects().name(project.get()).label("foo").create(input).get();
assertThat(createdLabel.canOverride).isTrue();
}
use of com.google.gerrit.extensions.common.LabelDefinitionInput in project gerrit by GerritCodeReview.
the class CreateLabelIT method emptyBranchesAreIgnored.
@Test
public void emptyBranchesAreIgnored() throws Exception {
LabelDefinitionInput input = new LabelDefinitionInput();
input.values = ImmutableMap.of("+1", "Looks Good", " 0", "Don't Know", "-1", "Looks Bad");
input.branches = ImmutableList.of("refs/heads/master", "", " ");
LabelDefinitionInfo createdLabel = gApi.projects().name(project.get()).label("Foo").create(input).get();
assertThat(createdLabel.branches).containsExactly("refs/heads/master");
}
use of com.google.gerrit.extensions.common.LabelDefinitionInput in project gerrit by GerritCodeReview.
the class CreateLabelIT method createWithIgnoreSelfApproval.
@Test
public void createWithIgnoreSelfApproval() throws Exception {
LabelDefinitionInput input = new LabelDefinitionInput();
input.values = ImmutableMap.of("+1", "Looks Good", " 0", "Don't Know", "-1", "Looks Bad");
input.ignoreSelfApproval = true;
LabelDefinitionInfo createdLabel = gApi.projects().name(project.get()).label("foo").create(input).get();
assertThat(createdLabel.ignoreSelfApproval).isTrue();
}
Aggregations