use of net.nemerosa.ontrack.extension.gitlab.model.GitLabIssueServiceConfiguration in project ontrack by nemerosa.
the class GitLabIssueServiceExtensionTest method init.
@Before
public void init() {
configurationService = mock(GitLabConfigurationService.class);
gitHubClientFactory = mock(OntrackGitLabClientFactory.class);
IssueExportServiceFactory issueExportServiceFactory = mock(IssueExportServiceFactory.class);
extension = new GitLabIssueServiceExtension(new GitLabExtensionFeature(new GitExtensionFeature(new SCMExtensionFeature())), issueExportServiceFactory, configurationService, gitHubClientFactory);
engineConfiguration = new GitLabConfiguration("test", "url", "", "", false);
configuration = new GitLabIssueServiceConfiguration(engineConfiguration, "nemerosa/ontrack");
issueWrapper = new GitLabIssueWrapper(new GitlabIssue(), "url/xxx", "url/xxx");
}
use of net.nemerosa.ontrack.extension.gitlab.model.GitLabIssueServiceConfiguration in project ontrack by nemerosa.
the class GitLabIssueServiceExtensionTest method issueServiceIdentifierContainsBothConfigurationAndRepository.
@Test
public void issueServiceIdentifierContainsBothConfigurationAndRepository() {
when(configurationService.getConfiguration("Test")).thenReturn(new GitLabConfiguration("Test", "https://gitlab.test.com", null, null, false));
IssueServiceConfiguration configuration = extension.getConfigurationByName("Test:nemerosa/ontrack");
assertEquals("gitlab", configuration.getServiceId());
assertEquals("Test:nemerosa/ontrack", configuration.getName());
assertTrue(configuration instanceof GitLabIssueServiceConfiguration);
GitLabIssueServiceConfiguration issueServiceConfiguration = (GitLabIssueServiceConfiguration) configuration;
assertEquals("Test", issueServiceConfiguration.getConfiguration().getName());
assertEquals("https://gitlab.test.com", issueServiceConfiguration.getConfiguration().getUrl());
assertEquals("nemerosa/ontrack", issueServiceConfiguration.getRepository());
}
use of net.nemerosa.ontrack.extension.gitlab.model.GitLabIssueServiceConfiguration in project ontrack by nemerosa.
the class GitLabIssueServiceExtension method getIssue.
@Override
public Issue getIssue(IssueServiceConfiguration issueServiceConfiguration, String issueKey) {
GitLabIssueServiceConfiguration configuration = (GitLabIssueServiceConfiguration) issueServiceConfiguration;
OntrackGitLabClient client = gitLabClientFactory.create(configuration.getConfiguration());
return client.getIssue(configuration.getRepository(), getIssueId(issueKey));
}
Aggregations