Search in sources :

Example 11 with ProjectStructureConfiguration

use of org.finos.legend.sdlc.server.project.config.ProjectStructureConfiguration in project legend-sdlc by finos.

the class TestGitLabServerRevisionApis method setUpRevisionApi.

/**
 * Authenticates with OAuth2 and instantiate the test resource.
 */
private static void setUpRevisionApi() {
    GitLabUserContext gitLabMemberUserContext = prepareGitLabMemberUserContext();
    GitLabUserContext gitLabOwnerUserContext = prepareGitLabOwnerUserContext();
    GitLabConfiguration gitLabConfig = GitLabConfiguration.newGitLabConfiguration(null, null, null, null, GitLabConfiguration.NewProjectVisibility.PRIVATE);
    ProjectStructureConfiguration projectStructureConfig = ProjectStructureConfiguration.emptyConfiguration();
    GitLabProjectApi gitLabProjectApi = new GitLabProjectApi(gitLabConfig, gitLabOwnerUserContext, projectStructureConfig, null, gitLabConfig, backgroundTaskProcessor, null);
    GitLabRevisionApi gitLabRevisionApi = new GitLabRevisionApi(gitLabMemberUserContext, backgroundTaskProcessor);
    GitLabWorkspaceApi gitLabWorkspaceApi = new GitLabWorkspaceApi(gitLabMemberUserContext, gitLabRevisionApi, backgroundTaskProcessor);
    GitLabEntityApi gitLabEntityApi = new GitLabEntityApi(gitLabMemberUserContext, backgroundTaskProcessor);
    gitLabRevisionApiTestResource = new GitLabRevisionApiTestResource(gitLabWorkspaceApi, gitLabProjectApi, gitLabEntityApi, gitLabRevisionApi);
}
Also used : GitLabWorkspaceApi(org.finos.legend.sdlc.server.gitlab.api.GitLabWorkspaceApi) GitLabConfiguration(org.finos.legend.sdlc.server.gitlab.GitLabConfiguration) GitLabRevisionApi(org.finos.legend.sdlc.server.gitlab.api.GitLabRevisionApi) GitLabProjectApi(org.finos.legend.sdlc.server.gitlab.api.GitLabProjectApi) GitLabUserContext(org.finos.legend.sdlc.server.gitlab.auth.GitLabUserContext) GitLabRevisionApiTestResource(org.finos.legend.sdlc.server.gitlab.api.GitLabRevisionApiTestResource) GitLabEntityApi(org.finos.legend.sdlc.server.gitlab.api.GitLabEntityApi) ProjectStructureConfiguration(org.finos.legend.sdlc.server.project.config.ProjectStructureConfiguration)

Example 12 with ProjectStructureConfiguration

use of org.finos.legend.sdlc.server.project.config.ProjectStructureConfiguration in project legend-sdlc by finos.

the class TestGitLabServerWorkspaceApis method setUpWorkspaceApi.

/**
 * Authenticates with OAuth2 and instantiate the test resource.
 */
private static void setUpWorkspaceApi() {
    GitLabUserContext gitLabMemberUserContext = prepareGitLabMemberUserContext();
    GitLabUserContext gitLabOwnerUserContext = prepareGitLabOwnerUserContext();
    GitLabConfiguration gitLabConfig = GitLabConfiguration.newGitLabConfiguration(null, null, null, null, GitLabConfiguration.NewProjectVisibility.PRIVATE);
    ProjectStructureConfiguration projectStructureConfig = ProjectStructureConfiguration.emptyConfiguration();
    GitLabProjectApi gitLabProjectApi = new GitLabProjectApi(gitLabConfig, gitLabOwnerUserContext, projectStructureConfig, null, gitLabConfig, backgroundTaskProcessor, null);
    GitLabRevisionApi gitLabRevisionApi = new GitLabRevisionApi(gitLabMemberUserContext, backgroundTaskProcessor);
    GitLabWorkspaceApi gitLabWorkspaceApi = new GitLabWorkspaceApi(gitLabMemberUserContext, gitLabRevisionApi, backgroundTaskProcessor);
    GitLabEntityApi gitLabEntityApi = new GitLabEntityApi(gitLabMemberUserContext, backgroundTaskProcessor);
    GitLabReviewApi gitLabCommitterReviewApi = new GitLabReviewApi(gitLabMemberUserContext);
    GitLabReviewApi gitLabApproverReviewApi = new GitLabReviewApi(gitLabOwnerUserContext);
    gitLabWorkspaceApiTestResource = new GitLabWorkspaceApiTestResource(gitLabWorkspaceApi, gitLabProjectApi, gitLabEntityApi, gitLabCommitterReviewApi, gitLabApproverReviewApi, gitLabMemberUserContext);
}
Also used : GitLabWorkspaceApi(org.finos.legend.sdlc.server.gitlab.api.GitLabWorkspaceApi) GitLabConfiguration(org.finos.legend.sdlc.server.gitlab.GitLabConfiguration) GitLabRevisionApi(org.finos.legend.sdlc.server.gitlab.api.GitLabRevisionApi) GitLabWorkspaceApiTestResource(org.finos.legend.sdlc.server.gitlab.api.GitLabWorkspaceApiTestResource) GitLabProjectApi(org.finos.legend.sdlc.server.gitlab.api.GitLabProjectApi) GitLabUserContext(org.finos.legend.sdlc.server.gitlab.auth.GitLabUserContext) GitLabEntityApi(org.finos.legend.sdlc.server.gitlab.api.GitLabEntityApi) ProjectStructureConfiguration(org.finos.legend.sdlc.server.project.config.ProjectStructureConfiguration) GitLabReviewApi(org.finos.legend.sdlc.server.gitlab.api.GitLabReviewApi)

Example 13 with ProjectStructureConfiguration

use of org.finos.legend.sdlc.server.project.config.ProjectStructureConfiguration in project legend-sdlc by finos.

the class AbstractBaseModule method resolveProjectStructureExtensionProvider.

private ProjectStructureExtensionProvider resolveProjectStructureExtensionProvider() {
    ProjectStructureConfiguration projectStructureConfiguration = getConfiguration().getProjectStructureConfiguration();
    if (projectStructureConfiguration != null) {
        ProjectStructureExtensionProvider configuredProvider = projectStructureConfiguration.getProjectStructureExtensionProvider();
        if (configuredProvider != null) {
            return configuredProvider;
        }
        List<ProjectStructureExtension> extensions = projectStructureConfiguration.getProjectStructureExtensions();
        if ((extensions != null) && !extensions.isEmpty()) {
            return DefaultProjectStructureExtensionProvider.fromExtensions(extensions);
        }
    }
    return new VoidProjectStructureExtensionProvider();
}
Also used : DefaultProjectStructureExtensionProvider(org.finos.legend.sdlc.server.project.extension.DefaultProjectStructureExtensionProvider) ProjectStructureExtensionProvider(org.finos.legend.sdlc.server.project.extension.ProjectStructureExtensionProvider) VoidProjectStructureExtensionProvider(org.finos.legend.sdlc.server.project.extension.VoidProjectStructureExtensionProvider) VoidProjectStructureExtensionProvider(org.finos.legend.sdlc.server.project.extension.VoidProjectStructureExtensionProvider) ProjectStructureExtension(org.finos.legend.sdlc.server.project.extension.ProjectStructureExtension) ProjectStructureConfiguration(org.finos.legend.sdlc.server.project.config.ProjectStructureConfiguration)

Aggregations

ProjectStructureConfiguration (org.finos.legend.sdlc.server.project.config.ProjectStructureConfiguration)13 GitLabConfiguration (org.finos.legend.sdlc.server.gitlab.GitLabConfiguration)12 GitLabProjectApi (org.finos.legend.sdlc.server.gitlab.api.GitLabProjectApi)12 GitLabUserContext (org.finos.legend.sdlc.server.gitlab.auth.GitLabUserContext)12 GitLabRevisionApi (org.finos.legend.sdlc.server.gitlab.api.GitLabRevisionApi)10 GitLabWorkspaceApi (org.finos.legend.sdlc.server.gitlab.api.GitLabWorkspaceApi)10 GitLabEntityApi (org.finos.legend.sdlc.server.gitlab.api.GitLabEntityApi)8 GitLabReviewApi (org.finos.legend.sdlc.server.gitlab.api.GitLabReviewApi)4 GitLabComparisonApi (org.finos.legend.sdlc.server.gitlab.api.GitLabComparisonApi)2 GitLabComparisonApiTestResource (org.finos.legend.sdlc.server.gitlab.api.GitLabComparisonApiTestResource)2 GitLabEntityApiTestResource (org.finos.legend.sdlc.server.gitlab.api.GitLabEntityApiTestResource)2 GitLabProjectApiTestResource (org.finos.legend.sdlc.server.gitlab.api.GitLabProjectApiTestResource)2 GitLabProjectConfigurationApi (org.finos.legend.sdlc.server.gitlab.api.GitLabProjectConfigurationApi)2 GitLabProjectConfigurationApiTestResource (org.finos.legend.sdlc.server.gitlab.api.GitLabProjectConfigurationApiTestResource)2 GitLabRevisionApiTestResource (org.finos.legend.sdlc.server.gitlab.api.GitLabRevisionApiTestResource)2 GitLabWorkspaceApiTestResource (org.finos.legend.sdlc.server.gitlab.api.GitLabWorkspaceApiTestResource)2 DefaultProjectStructureExtensionProvider (org.finos.legend.sdlc.server.project.extension.DefaultProjectStructureExtensionProvider)1 ProjectStructureExtension (org.finos.legend.sdlc.server.project.extension.ProjectStructureExtension)1 ProjectStructureExtensionProvider (org.finos.legend.sdlc.server.project.extension.ProjectStructureExtensionProvider)1 VoidProjectStructureExtensionProvider (org.finos.legend.sdlc.server.project.extension.VoidProjectStructureExtensionProvider)1