use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class SetLabelIT method setIgnoreSelfApproval.
@Test
public void setIgnoreSelfApproval() throws Exception {
configLabel("foo", LabelFunction.NO_OP);
assertThat(gApi.projects().name(project.get()).label("foo").get().ignoreSelfApproval).isNull();
LabelDefinitionInput input = new LabelDefinitionInput();
input.ignoreSelfApproval = true;
LabelDefinitionInfo updatedLabel = gApi.projects().name(project.get()).label("foo").update(input);
assertThat(updatedLabel.ignoreSelfApproval).isTrue();
assertThat(gApi.projects().name(project.get()).label("foo").get().ignoreSelfApproval).isTrue();
}
use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class SetLabelIT method unsetAllowPostSubmit.
@Test
public void unsetAllowPostSubmit() throws Exception {
configLabel("foo", LabelFunction.NO_OP);
assertThat(gApi.projects().name(project.get()).label("foo").get().allowPostSubmit).isTrue();
LabelDefinitionInput input = new LabelDefinitionInput();
input.allowPostSubmit = false;
LabelDefinitionInfo updatedLabel = gApi.projects().name(project.get()).label("foo").update(input);
assertThat(updatedLabel.allowPostSubmit).isNull();
assertThat(gApi.projects().name(project.get()).label("foo").get().allowPostSubmit).isNull();
}
use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class SetLabelIT method nameIsTrimmed.
@Test
public void nameIsTrimmed() throws Exception {
LabelDefinitionInput input = new LabelDefinitionInput();
input.name = " Foo-Review ";
LabelDefinitionInfo updatedLabel = gApi.projects().name(allProjects.get()).label(LabelId.CODE_REVIEW).update(input);
assertThat(updatedLabel.name).isEqualTo("Foo-Review");
assertThat(gApi.projects().name(allProjects.get()).label("Foo-Review").get()).isNotNull();
assertThrows(ResourceNotFoundException.class, () -> gApi.projects().name(allProjects.get()).label(LabelId.CODE_REVIEW).get());
}
use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class SetLabelIT method setCopyAllScoresOnMergeFirstParentUpdate.
@Test
public void setCopyAllScoresOnMergeFirstParentUpdate() throws Exception {
configLabel("foo", LabelFunction.NO_OP);
assertThat(gApi.projects().name(project.get()).label("foo").get().copyAllScoresOnMergeFirstParentUpdate).isNull();
LabelDefinitionInput input = new LabelDefinitionInput();
input.copyAllScoresOnMergeFirstParentUpdate = true;
LabelDefinitionInfo updatedLabel = gApi.projects().name(project.get()).label("foo").update(input);
assertThat(updatedLabel.copyAllScoresOnMergeFirstParentUpdate).isTrue();
assertThat(gApi.projects().name(project.get()).label("foo").get().copyAllScoresOnMergeFirstParentUpdate).isTrue();
}
use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class SetLabelIT method setCopyAnyScore.
@Test
public void setCopyAnyScore() throws Exception {
configLabel("foo", LabelFunction.NO_OP);
assertThat(gApi.projects().name(project.get()).label("foo").get().copyAnyScore).isNull();
LabelDefinitionInput input = new LabelDefinitionInput();
input.copyAnyScore = true;
LabelDefinitionInfo updatedLabel = gApi.projects().name(project.get()).label("foo").update(input);
assertThat(updatedLabel.copyAnyScore).isTrue();
assertThat(gApi.projects().name(project.get()).label("foo").get().copyAnyScore).isTrue();
}
Aggregations