use of com.google.gerrit.extensions.api.projects.ConfigInfo in project gerrit by GerritCodeReview.
the class ProjectIT method setConfig.
@Test
public void setConfig() throws Exception {
ConfigInput input = createTestConfigInput();
ConfigInfo info = gApi.projects().name(project.get()).config(input);
assertThat(info.description).isEqualTo(input.description);
assertThat(info.useContributorAgreements.configuredValue).isEqualTo(input.useContributorAgreements);
assertThat(info.useContentMerge.configuredValue).isEqualTo(input.useContentMerge);
assertThat(info.useSignedOffBy.configuredValue).isEqualTo(input.useSignedOffBy);
assertThat(info.createNewChangeForAllNotInTarget.configuredValue).isEqualTo(input.createNewChangeForAllNotInTarget);
assertThat(info.requireChangeId.configuredValue).isEqualTo(input.requireChangeId);
assertThat(info.rejectImplicitMerges.configuredValue).isEqualTo(input.rejectImplicitMerges);
assertThat(info.enableReviewerByEmail.configuredValue).isEqualTo(input.enableReviewerByEmail);
assertThat(info.createNewChangeForAllNotInTarget.configuredValue).isEqualTo(input.createNewChangeForAllNotInTarget);
assertThat(info.maxObjectSizeLimit.configuredValue).isEqualTo(input.maxObjectSizeLimit);
assertThat(info.submitType).isEqualTo(input.submitType);
assertThat(info.state).isEqualTo(input.state);
}
use of com.google.gerrit.extensions.api.projects.ConfigInfo in project gerrit by GerritCodeReview.
the class ProjectIT method configChangeCausesRefUpdate.
@Test
public void configChangeCausesRefUpdate() throws Exception {
RevCommit initialHead = getRemoteHead(project, RefNames.REFS_CONFIG);
ConfigInfo info = gApi.projects().name(project.get()).config();
assertThat(info.submitType).isEqualTo(SubmitType.MERGE_IF_NECESSARY);
ConfigInput input = new ConfigInput();
input.submitType = SubmitType.CHERRY_PICK;
info = gApi.projects().name(project.get()).config(input);
assertThat(info.submitType).isEqualTo(SubmitType.CHERRY_PICK);
info = gApi.projects().name(project.get()).config();
assertThat(info.submitType).isEqualTo(SubmitType.CHERRY_PICK);
RevCommit updatedHead = getRemoteHead(project, RefNames.REFS_CONFIG);
eventRecorder.assertRefUpdatedEvents(project.get(), RefNames.REFS_CONFIG, initialHead, updatedHead);
}
use of com.google.gerrit.extensions.api.projects.ConfigInfo in project gerrit by GerritCodeReview.
the class ProjectIT method setPartialConfig.
@Test
public void setPartialConfig() throws Exception {
ConfigInput input = createTestConfigInput();
ConfigInfo info = gApi.projects().name(project.get()).config(input);
ConfigInput partialInput = new ConfigInput();
partialInput.useContributorAgreements = InheritableBoolean.FALSE;
info = gApi.projects().name(project.get()).config(partialInput);
assertThat(info.description).isNull();
assertThat(info.useContributorAgreements.configuredValue).isEqualTo(partialInput.useContributorAgreements);
assertThat(info.useContentMerge.configuredValue).isEqualTo(input.useContentMerge);
assertThat(info.useSignedOffBy.configuredValue).isEqualTo(input.useSignedOffBy);
assertThat(info.createNewChangeForAllNotInTarget.configuredValue).isEqualTo(input.createNewChangeForAllNotInTarget);
assertThat(info.requireChangeId.configuredValue).isEqualTo(input.requireChangeId);
assertThat(info.rejectImplicitMerges.configuredValue).isEqualTo(input.rejectImplicitMerges);
assertThat(info.enableReviewerByEmail.configuredValue).isEqualTo(input.enableReviewerByEmail);
assertThat(info.createNewChangeForAllNotInTarget.configuredValue).isEqualTo(input.createNewChangeForAllNotInTarget);
assertThat(info.maxObjectSizeLimit.configuredValue).isEqualTo(input.maxObjectSizeLimit);
assertThat(info.submitType).isEqualTo(input.submitType);
assertThat(info.state).isEqualTo(input.state);
}
Aggregations