use of net.nemerosa.ontrack.extension.github.service.GitHubIssueServiceConfiguration in project ontrack by nemerosa.
the class GitHubIssueServiceExtension method getIssue.
@Override
public Issue getIssue(IssueServiceConfiguration issueServiceConfiguration, String issueKey) {
GitHubIssueServiceConfiguration configuration = (GitHubIssueServiceConfiguration) issueServiceConfiguration;
OntrackGitHubClient client = gitHubClientFactory.create(configuration.getConfiguration());
return client.getIssue(configuration.getRepository(), getIssueId(issueKey));
}
use of net.nemerosa.ontrack.extension.github.service.GitHubIssueServiceConfiguration in project ontrack by nemerosa.
the class GitHubIssueServiceExtensionTest method init.
@Before
public void init() {
configurationService = mock(GitHubConfigurationService.class);
OntrackGitHubClientFactory gitHubClientFactory = mock(OntrackGitHubClientFactory.class);
IssueExportServiceFactory issueExportServiceFactory = mock(IssueExportServiceFactory.class);
extension = new GitHubIssueServiceExtension(new GitHubExtensionFeature(new GitExtensionFeature(new SCMExtensionFeature())), configurationService, gitHubClientFactory, issueExportServiceFactory);
GitHubEngineConfiguration engineConfiguration = new GitHubEngineConfiguration("test", "url", "", "", "");
configuration = new GitHubIssueServiceConfiguration(engineConfiguration, "nemerosa/ontrack");
}
use of net.nemerosa.ontrack.extension.github.service.GitHubIssueServiceConfiguration in project ontrack by nemerosa.
the class GitHubIssueServiceExtensionTest method issueServiceIdentifierContainsBothConfigurationAndRepository.
@Test
public void issueServiceIdentifierContainsBothConfigurationAndRepository() {
when(configurationService.getConfiguration("Test")).thenReturn(new GitHubEngineConfiguration("Test", null, null, null, null));
IssueServiceConfiguration configuration = extension.getConfigurationByName("Test:nemerosa/ontrack");
assertEquals("github", configuration.getServiceId());
assertEquals("Test:nemerosa/ontrack", configuration.getName());
assertTrue(configuration instanceof GitHubIssueServiceConfiguration);
GitHubIssueServiceConfiguration issueServiceConfiguration = (GitHubIssueServiceConfiguration) configuration;
assertEquals("Test", issueServiceConfiguration.getConfiguration().getName());
assertEquals("https://github.com", issueServiceConfiguration.getConfiguration().getUrl());
assertEquals("nemerosa/ontrack", issueServiceConfiguration.getRepository());
}
Aggregations