use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class CreateLabelIT method createWithCopyCondition.
@Test
public void createWithCopyCondition() throws Exception {
LabelDefinitionInput input = new LabelDefinitionInput();
input.values = ImmutableMap.of("+1", "Looks Good", " 0", "Don't Know", "-1", "Looks Bad");
input.copyCondition = "is:MAX";
LabelDefinitionInfo createdLabel = gApi.projects().name(project.get()).label("foo").create(input).get();
assertThat(createdLabel.copyCondition).isEqualTo("is:MAX");
}
use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class CreateLabelIT method branchesAreTrimmed.
@Test
public void branchesAreTrimmed() 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 ", " refs/heads/foo/* ", " ^refs/heads/stable-.* ");
LabelDefinitionInfo createdLabel = gApi.projects().name(project.get()).label("Foo").create(input).get();
assertThat(createdLabel.branches).containsExactly("refs/heads/master", "refs/heads/foo/*", "^refs/heads/stable-.*");
}
use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class CreateLabelIT method createWithDefaultValue.
@Test
public void createWithDefaultValue() throws Exception {
LabelDefinitionInput input = new LabelDefinitionInput();
input.values = ImmutableMap.of("+1", "Looks Good", " 0", "Don't Know", "-1", "Looks Bad");
input.defaultValue = 1;
LabelDefinitionInfo createdLabel = gApi.projects().name(project.get()).label("Foo").create(input).get();
assertThat(createdLabel.defaultValue).isEqualTo(input.defaultValue);
}
use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class CreateLabelIT method branchesAreAutomaticallyPrefixedWithRefsHeads.
@Test
public void branchesAreAutomaticallyPrefixedWithRefsHeads() throws Exception {
LabelDefinitionInput input = new LabelDefinitionInput();
input.values = ImmutableMap.of("+1", "Looks Good", " 0", "Don't Know", "-1", "Looks Bad");
input.branches = ImmutableList.of("master", "refs/meta/config");
LabelDefinitionInfo createdLabel = gApi.projects().name(project.get()).label("Foo").create(input).get();
assertThat(createdLabel.branches).containsExactly("refs/heads/master", "refs/meta/config");
}
use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class CreateLabelIT method createWithCopyValues.
@Test
public void createWithCopyValues() throws Exception {
LabelDefinitionInput input = new LabelDefinitionInput();
input.values = ImmutableMap.of("+1", "Looks Good", " 0", "Don't Know", "-1", "Looks Bad");
input.copyValues = ImmutableList.of((short) -1, (short) 1);
LabelDefinitionInfo createdLabel = gApi.projects().name(project.get()).label("foo").create(input).get();
assertThat(createdLabel.copyValues).containsExactly((short) -1, (short) 1).inOrder();
}
Aggregations