use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class SetLabelIT method updateDefaultValue.
@Test
public void updateDefaultValue() throws Exception {
LabelDefinitionInput input = new LabelDefinitionInput();
input.defaultValue = 1;
LabelDefinitionInfo updatedLabel = gApi.projects().name(allProjects.get()).label(LabelId.CODE_REVIEW).update(input);
assertThat(updatedLabel.defaultValue).isEqualTo(input.defaultValue);
assertThat(gApi.projects().name(allProjects.get()).label(LabelId.CODE_REVIEW).get().defaultValue).isEqualTo(input.defaultValue);
}
use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class SetLabelIT method noOpUpdate.
@Test
public void noOpUpdate() throws Exception {
RevCommit refsMetaConfigHead = projectOperations.project(allProjects).getHead(RefNames.REFS_CONFIG);
LabelDefinitionInfo updatedLabel = gApi.projects().name(allProjects.get()).label(LabelId.CODE_REVIEW).update(new LabelDefinitionInput());
LabelAssert.assertCodeReviewLabel(updatedLabel);
LabelAssert.assertCodeReviewLabel(gApi.projects().name(allProjects.get()).label(LabelId.CODE_REVIEW).get());
assertThat(projectOperations.project(allProjects).getHead(RefNames.REFS_CONFIG)).isEqualTo(refsMetaConfigHead);
}
use of com.google.gerrit.extensions.common.LabelDefinitionInfo in project gerrit by GerritCodeReview.
the class SetLabelIT method unsetCopyAllScoresIfListOfFilesDidNotChange.
@Test
public void unsetCopyAllScoresIfListOfFilesDidNotChange() throws Exception {
configLabel("foo", LabelFunction.NO_OP);
try (ProjectConfigUpdate u = updateProject(project)) {
u.getConfig().updateLabelType("foo", lt -> lt.setCopyAllScoresIfListOfFilesDidNotChange(true));
u.save();
}
assertThat(gApi.projects().name(project.get()).label("foo").get().copyAllScoresIfListOfFilesDidNotChange).isTrue();
LabelDefinitionInput input = new LabelDefinitionInput();
input.copyAllScoresIfListOfFilesDidNotChange = false;
LabelDefinitionInfo updatedLabel = gApi.projects().name(project.get()).label("foo").update(input);
assertThat(updatedLabel.copyAllScoresIfListOfFilesDidNotChange).isNull();
assertThat(gApi.projects().name(project.get()).label("foo").get().copyAllScoresIfListOfFilesDidNotChange).isNull();
}
Aggregations