Search in sources :

Example 6 with GitlabManagerPrivileged

use of de.catma.repository.git.managers.GitlabManagerPrivileged in project catma by forTEXT.

the class GitSourceDocumentHandlerTest method setUp.

@BeforeEach
public void setUp() throws Exception {
    // create a fake CATMA user which we'll use to instantiate GitlabManagerRestricted (using the corresponding impersonation token) & JGitRepoManager
    Integer randomUserId = Integer.parseInt(RandomStringUtils.randomNumeric(3));
    String username = String.format("testuser-%s", randomUserId);
    String email = String.format("%s@catma.de", username);
    String name = String.format("Test User %s", randomUserId);
    gitlabManagerPrivileged = new GitlabManagerPrivileged();
    String impersonationToken = gitlabManagerPrivileged.acquireImpersonationToken(username, "catma", email, name).getSecond();
    EventBus mockEventBus = mock(EventBus.class);
    BackgroundService mockBackgroundService = mock(BackgroundService.class);
    gitlabManagerRestricted = new GitlabManagerRestricted(mockEventBus, mockBackgroundService, impersonationToken);
}
Also used : BackgroundService(de.catma.backgroundservice.BackgroundService) GitlabManagerPrivileged(de.catma.repository.git.managers.GitlabManagerPrivileged) GitlabManagerRestricted(de.catma.repository.git.managers.GitlabManagerRestricted) EventBus(com.google.common.eventbus.EventBus) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

GitlabManagerPrivileged (de.catma.repository.git.managers.GitlabManagerPrivileged)6 GitUser (de.catma.repository.git.GitUser)3 EventBus (com.google.common.eventbus.EventBus)2 BackgroundService (de.catma.backgroundservice.BackgroundService)2 IRemoteGitManagerPrivileged (de.catma.repository.git.interfaces.IRemoteGitManagerPrivileged)2 GitlabManagerRestricted (de.catma.repository.git.managers.GitlabManagerRestricted)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 GitProjectManager (de.catma.repository.git.GitProjectManager)1 IRemoteGitManagerRestricted (de.catma.repository.git.interfaces.IRemoteGitManagerRestricted)1 CatmaHeader (de.catma.ui.module.main.CatmaHeader)1 MainView (de.catma.ui.module.main.MainView)1 NotLoggedInMainView (de.catma.ui.module.main.NotLoggedInMainView)1