use of com.google.gerrit.server.account.externalids.ExternalIdNotes in project gerrit by GerritCodeReview.
the class OnlineExternalIdCaseSensivityMigratorIT method shouldSkipMigrationWhenUserNameCaseInsensitiveIsSetToFalse.
@Test
@GerritConfig(name = "auth.userNameCaseInsensitive", value = "false")
@GerritConfig(name = "auth.userNameCaseInsensitiveMigrationMode", value = "true")
public void shouldSkipMigrationWhenUserNameCaseInsensitiveIsSetToFalse() throws RepositoryNotFoundException, IOException, ConfigInvalidException {
try (Repository allUsersRepo = repoManager.openRepository(allUsers);
MetaDataUpdate md = metaDataUpdateFactory.create(allUsers)) {
ExternalIdNotes extIdNotes = externalIdNotesFactory.load(allUsersRepo);
createExternalId(md, extIdNotes, SCHEME_USERNAME, "JonDoe", accountId, isUserNameCaseInsensitive);
assertThat(getExactExternalId(extIdNotes, SCHEME_USERNAME, "JonDoe").isPresent()).isTrue();
assertThat(getExactExternalId(extIdNotes, SCHEME_USERNAME, "jondoe").isPresent()).isFalse();
objectUnderTest.migrate();
extIdNotes = externalIdNotesFactory.load(allUsersRepo);
assertThat(getExactExternalId(extIdNotes, SCHEME_USERNAME, "JonDoe").isPresent()).isTrue();
assertThat(getExactExternalId(extIdNotes, SCHEME_USERNAME, "jondoe").isPresent()).isFalse();
}
}
Aggregations