boolean isUserConsentRequiredAfterUpgrade();
+ String getProjectsPermissionsProvisioningTaskName();
+
}
import static org.mockito.Mockito.when;
import static org.sonar.auth.github.GitHubSettings.GITHUB_PROVISION_PROJECT_VISIBILITY;
import static org.sonar.auth.github.GitHubSettings.GITHUB_USER_CONSENT_FOR_PERMISSIONS_REQUIRED_AFTER_UPGRADE;
+import static org.sonar.db.ce.CeTaskTypes.GITHUB_PROJECT_PERMISSIONS_PROVISIONING;
public class GitHubSettingsIT {
@Rule
settings.setProperty("sonar.auth.github.appId", "id");
settings.setProperty("sonar.auth.github.privateKey.secured", "secret");
}
+
+ @Test
+ public void getProjectsPermissionsProvisioningTaskName_returnsCorrectTaskName() {
+ assertThat(underTest.getProjectsPermissionsProvisioningTaskName()).isEqualTo(GITHUB_PROJECT_PERMISSIONS_PROVISIONING);
+ }
+
}
import static org.sonar.api.PropertyType.PASSWORD;
import static org.sonar.api.PropertyType.STRING;
import static org.sonar.api.utils.Preconditions.checkState;
+import static org.sonar.db.ce.CeTaskTypes.GITHUB_PROJECT_PERMISSIONS_PROVISIONING;
@ServerSide
@ComputeEngineSide
return configuration.get(GITHUB_USER_CONSENT_FOR_PERMISSIONS_REQUIRED_AFTER_UPGRADE).isPresent();
}
+ @Override
+ public String getProjectsPermissionsProvisioningTaskName() {
+ return GITHUB_PROJECT_PERMISSIONS_PROVISIONING;
+ }
+
@Override
public boolean isProjectVisibilitySynchronizationActivated() {
return configuration.getBoolean(GITHUB_PROVISION_PROJECT_VISIBILITY).orElse(true);
import static java.lang.String.valueOf;
import static org.sonar.api.PropertyType.BOOLEAN;
import static org.sonar.api.PropertyType.PASSWORD;
+import static org.sonar.db.ce.CeTaskTypes.GITLAB_PROJECT_PERMISSIONS_PROVISIONING;
@ComputeEngineSide
public class GitLabSettings implements DevOpsPlatformSettings {
return configuration.getBoolean(GITLAB_USER_CONSENT_FOR_PERMISSION_PROVISIONING_REQUIRED).isPresent();
}
+ @Override
+ public String getProjectsPermissionsProvisioningTaskName() {
+ return GITLAB_PROJECT_PERMISSIONS_PROVISIONING;
+ }
+
static List<PropertyDefinition> definitions() {
return Arrays.asList(
PropertyDefinition.builder(GITLAB_AUTH_ENABLED)
import static org.sonar.auth.gitlab.GitLabSettings.GITLAB_AUTH_SYNC_USER_GROUPS;
import static org.sonar.auth.gitlab.GitLabSettings.GITLAB_AUTH_URL;
import static org.sonar.auth.gitlab.GitLabSettings.GITLAB_USER_CONSENT_FOR_PERMISSION_PROVISIONING_REQUIRED;
+import static org.sonar.db.ce.CeTaskTypes.GITLAB_PROJECT_PERMISSIONS_PROVISIONING;
public class GitLabSettingsTest {
assertThat(config.isUserConsentRequiredAfterUpgrade()).isTrue();
}
+ @Test
+ public void getProjectsPermissionsProvisioningTaskName_returnsCorrectTaskName() {
+ assertThat(config.getProjectsPermissionsProvisioningTaskName()).isEqualTo(GITLAB_PROJECT_PERMISSIONS_PROVISIONING);
+ }
+
private void enableGitlabAuthentication() {
settings.setProperty(GITLAB_AUTH_ENABLED, true);
settings.setProperty(GITLAB_AUTH_APPLICATION_ID, "on");