use of com.google.gerrit.acceptance.config.GerritConfig in project gerrit by GerritCodeReview.
the class ServerInfoIT method serverConfig.
@Test
// accounts
@GerritConfig(name = "accounts.visibility", value = "VISIBLE_GROUP")
@GerritConfig(name = "accounts.defaultDisplayName", value = "FIRST_NAME")
// auth
@GerritConfig(name = "auth.type", value = "HTTP")
@GerritConfig(name = "auth.contributorAgreements", value = "true")
@GerritConfig(name = "auth.loginUrl", value = "https://example.com/login")
@GerritConfig(name = "auth.loginText", value = "LOGIN")
@GerritConfig(name = "auth.switchAccountUrl", value = "https://example.com/switch")
// auth fields ignored when auth == HTTP
@GerritConfig(name = "auth.registerUrl", value = "https://example.com/register")
@GerritConfig(name = "auth.registerText", value = "REGISTER")
@GerritConfig(name = "auth.editFullNameUrl", value = "https://example.com/editname")
@GerritConfig(name = "auth.httpPasswordUrl", value = "https://example.com/password")
// change
@GerritConfig(name = "change.updateDelay", value = "50s")
@GerritConfig(name = "change.disablePrivateChanges", value = "true")
@GerritConfig(name = "change.enableAttentionSet", value = "true")
@GerritConfig(name = "change.enableAssignee", value = "true")
// download
@GerritConfig(name = "download.archive", values = { "tar", "tbz2", "tgz", "txz" })
// gerrit
@GerritConfig(name = "gerrit.allProjects", value = "Root")
@GerritConfig(name = "gerrit.allUsers", value = "Users")
@GerritConfig(name = "gerrit.reportBugUrl", value = "https://example.com/report")
@GerritConfig(name = "gerrit.instanceId", value = "devops-instance")
// suggest
@GerritConfig(name = "suggest.from", value = "3")
// user
@GerritConfig(name = "user.anonymousCoward", value = "Unnamed User")
public void serverConfig() throws Exception {
ServerInfo i = gApi.config().server().getInfo();
// accounts
assertThat(i.accounts.visibility).isEqualTo(AccountVisibility.VISIBLE_GROUP);
assertThat(i.accounts.defaultDisplayName).isEqualTo(AccountDefaultDisplayName.FIRST_NAME);
// auth
assertThat(i.auth.authType).isEqualTo(AuthType.HTTP);
assertThat(i.auth.editableAccountFields).containsExactly(AccountFieldName.REGISTER_NEW_EMAIL, AccountFieldName.FULL_NAME);
assertThat(i.auth.useContributorAgreements).isTrue();
assertThat(i.auth.loginUrl).isEqualTo("https://example.com/login");
assertThat(i.auth.loginText).isEqualTo("LOGIN");
assertThat(i.auth.switchAccountUrl).isEqualTo("https://example.com/switch");
assertThat(i.auth.registerUrl).isNull();
assertThat(i.auth.registerText).isNull();
assertThat(i.auth.editFullNameUrl).isNull();
assertThat(i.auth.httpPasswordUrl).isNull();
// change
assertThat(i.change.updateDelay).isEqualTo(50);
assertThat(i.change.disablePrivateChanges).isTrue();
assertThat(i.change.enableAttentionSet).isTrue();
assertThat(i.change.enableAssignee).isTrue();
// download
assertThat(i.download.archives).containsExactly("tar", "tbz2", "tgz", "txz");
assertThat(i.download.schemes).isEmpty();
// gerrit
assertThat(i.gerrit.allProjects).isEqualTo("Root");
assertThat(i.gerrit.allUsers).isEqualTo("Users");
assertThat(i.gerrit.reportBugUrl).isEqualTo("https://example.com/report");
assertThat(i.gerrit.instanceId).isEqualTo("devops-instance");
// plugin
assertThat(i.plugin.jsResourcePaths).isEmpty();
// sshd
assertThat(i.sshd).isNotNull();
// suggest
assertThat(i.suggest.from).isEqualTo(3);
// user
assertThat(i.user.anonymousCowardName).isEqualTo("Unnamed User");
// notedb
assertThat(gApi.config().server().getInfo().noteDbEnabled).isTrue();
}
use of com.google.gerrit.acceptance.config.GerritConfig in project gerrit by GerritCodeReview.
the class ServerInfoIT method serverConfigWithMultipleSubmitRequirementColumn.
@Test
@GerritConfig(name = "dashboard.submitRequirementColumns", values = { "Code-Review", "Verified" })
public void serverConfigWithMultipleSubmitRequirementColumn() throws Exception {
ServerInfo i = gApi.config().server().getInfo();
assertThat(i.submitRequirementDashboardColumns).containsExactly("Code-Review", "Verified");
}
use of com.google.gerrit.acceptance.config.GerritConfig in project gerrit by GerritCodeReview.
the class ServerInfoIT method serverConfigWithSubmitWholeTopic.
@Test
@GerritConfig(name = "change.submitWholeTopic", value = "true")
public void serverConfigWithSubmitWholeTopic() throws Exception {
ServerInfo i = gApi.config().server().getInfo();
assertThat(i.change.submitWholeTopic).isTrue();
}
use of com.google.gerrit.acceptance.config.GerritConfig in project gerrit by GerritCodeReview.
the class ExternalIdIT method shouldTolerateDuplicateExternalIdsWhenInMigrationMode.
@Test
@GerritConfig(name = "auth.userNameCaseInsensitive", value = "true")
@GerritConfig(name = "auth.userNameCaseInsensitiveMigrationMode", value = "true")
public void shouldTolerateDuplicateExternalIdsWhenInMigrationMode() throws Exception {
Account.Id firstAccountId = Account.id(1);
Account.Id secondAccountId = Account.id(2);
try (Repository allUsersRepo = repoManager.openRepository(allUsers);
MetaDataUpdate md = metaDataUpdateFactory.create(allUsers)) {
ExternalIdNotes extIdNotes = externalIdNotesFactory.load(allUsersRepo);
createExternalId(md, extIdNotes, SCHEME_GERRIT, "janedoe", firstAccountId, CASE_SENSITIVE_USERNAME);
createExternalId(md, extIdNotes, SCHEME_GERRIT, "JaneDoe", secondAccountId, CASE_SENSITIVE_USERNAME);
ExternalId.Key firstAccountExternalId = externalIdKeyFactory.create(SCHEME_GERRIT, "janedoe", CASE_INSENSITIVE_USERNAME);
assertThat(externalIds.get(firstAccountExternalId).get().accountId()).isEqualTo(firstAccountId);
ExternalId.Key secondAccountExternalId = externalIdKeyFactory.create(SCHEME_GERRIT, "JaneDoe", CASE_INSENSITIVE_USERNAME);
assertThat(externalIds.get(secondAccountExternalId).get().accountId()).isEqualTo(secondAccountId);
}
}
use of com.google.gerrit.acceptance.config.GerritConfig in project gerrit by GerritCodeReview.
the class ExternalIdIT method createCaseSensitiveExternalId_SchemeWithoutUsername.
@Test
@GerritConfig(name = "auth.userNameCaseInsensitive", value = "true")
public void createCaseSensitiveExternalId_SchemeWithoutUsername() throws Exception {
try (Repository allUsersRepo = repoManager.openRepository(allUsers);
MetaDataUpdate md = metaDataUpdateFactory.create(allUsers)) {
ExternalIdNotes extIdNotes = externalIdNotesFactory.load(allUsersRepo);
testCaseSensitiveExternalIdKey(md, extIdNotes, SCHEME_MAILTO, "Jane@doe.com", Account.id(66));
testCaseSensitiveExternalIdKey(md, extIdNotes, SCHEME_UUID, "1234ABCD", Account.id(66));
testCaseSensitiveExternalIdKey(md, extIdNotes, SCHEME_GPGKEY, "1234ABCD", Account.id(66));
}
}
Aggregations