Merge with 2.0.0-m3

This commit is contained in:
Rene Pfeuffer
2019-11-25 14:35:47 +01:00
39 changed files with 499 additions and 197 deletions

View File

@@ -70,7 +70,19 @@ class SetupContextListenerTest {
}
@Test
void shouldCreateAdminAccountAndAssignPermissions() {
void shouldCreateAdminAccountIfNoUserExistsAndAssignPermissions() {
when(passwordService.encryptPassword("scmadmin")).thenReturn("secret");
setupContextListener.contextInitialized(null);
verifyAdminCreated();
verifyAdminPermissionsAssigned();
}
@Test
void shouldCreateAdminAccountIfOnlyAnonymousUserExistsAndAssignPermissions() {
when(userManager.getAll()).thenReturn(Lists.newArrayList(SCMContext.ANONYMOUS));
when(userManager.contains(SCMContext.USER_ANONYMOUS)).thenReturn(true);
when(passwordService.encryptPassword("scmadmin")).thenReturn("secret");
setupContextListener.contextInitialized(null);