mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 17:05:43 +01:00
fix integration tests
This commit is contained in:
@@ -53,7 +53,6 @@ class AnonymousAccessITCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void shouldRejectRepositoryResourceWithoutAuthentication() {
|
void shouldRejectRepositoryResourceWithoutAuthentication() {
|
||||||
setAnonymousAccess(false);
|
|
||||||
assertEquals(401, RestAssured.given()
|
assertEquals(401, RestAssured.given()
|
||||||
.when()
|
.when()
|
||||||
.get(RestUtil.REST_BASE_URL.resolve("repositories/"))
|
.get(RestUtil.REST_BASE_URL.resolve("repositories/"))
|
||||||
|
|||||||
@@ -38,12 +38,13 @@ public class PublicFlagUpdateStep implements UpdateStep {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doUpdate() throws JAXBException {
|
public void doUpdate() throws JAXBException {
|
||||||
createNewAnonymousUserIfNotExists();
|
|
||||||
deleteOldAnonymousUserIfAvailable();
|
|
||||||
|
|
||||||
LOG.info("Migrating public flags of repositories as RepositoryRolePermission 'READ' for user '_anonymous'");
|
LOG.info("Migrating public flags of repositories as RepositoryRolePermission 'READ' for user '_anonymous'");
|
||||||
V1RepositoryHelper.readV1Database(contextProvider, V1_REPOSITORY_BACKUP_FILENAME).ifPresent(
|
V1RepositoryHelper.readV1Database(contextProvider, V1_REPOSITORY_BACKUP_FILENAME).ifPresent(
|
||||||
this::addRepositoryReadPermissionForAnonymousUser
|
v1RepositoryDatabase -> {
|
||||||
|
createNewAnonymousUserIfNotExists();
|
||||||
|
deleteOldAnonymousUserIfAvailable();
|
||||||
|
addRepositoryReadPermissionForAnonymousUser(v1RepositoryDatabase);
|
||||||
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user