use of org.gitlab.api.models.GitlabIssue 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 org.gitlab.api.models.GitlabIssue in project ontrack by nemerosa.
the class DefaultOntrackGitLabClient method getIssue.
@Override
public GitLabIssueWrapper getIssue(String repository, int id) {
try {
// Issue
String issueUrl = configuration.getUrl() + "/" + repository + GitlabIssue.URL + "/" + id;
GitlabIssue issue = api.getIssue(repository, id);
// Milestone URL
String milestoneUrl = null;
if (issue.getMilestone() != null) {
milestoneUrl = configuration.getUrl() + "/" + repository + GitlabMilestone.URL + "/" + issue.getMilestone().getId();
}
// OK
return GitLabIssueWrapper.of(issue, milestoneUrl, issueUrl);
} catch (IOException e) {
throw new OntrackGitLabClientException(e);
}
}
Aggregations