use of net.nemerosa.ontrack.extension.scm.SCMExtensionFeature 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.scm.SCMExtensionFeature in project ontrack by nemerosa.
the class SVNBranchConfigurationPropertyTypeTest method not_editable_when_project_not_configured.
@Test
public void not_editable_when_project_not_configured() {
Project project = Project.of(new NameDescription("P", "Project")).withId(ID.of(1));
Branch branch = Branch.of(project, new NameDescription("B", "Branch")).withId(ID.of(1));
PropertyService propertiesService = mock(PropertyService.class);
when(propertiesService.hasProperty(project, SVNProjectConfigurationPropertyType.class)).thenReturn(false);
SecurityService securityService = mock(SecurityService.class);
when(securityService.isProjectFunctionGranted(1, ProjectConfig.class)).thenReturn(true);
BuildSvnRevisionLinkService buildSvnRevisionLinkService = mock(BuildSvnRevisionLinkService.class);
TagNameSvnRevisionLink tagNameSvnRevisionLink = new TagNameSvnRevisionLink(mock(SVNService.class), mock(StructureService.class));
SVNBranchConfigurationPropertyType propertyType = new SVNBranchConfigurationPropertyType(new SVNExtensionFeature(new SCMExtensionFeature()), propertiesService, buildSvnRevisionLinkService, tagNameSvnRevisionLink);
assertFalse(propertyType.canEdit(branch, securityService));
}
use of net.nemerosa.ontrack.extension.scm.SCMExtensionFeature in project ontrack by nemerosa.
the class SVNBranchConfigurationPropertyTypeTest method editable_when_project_configured.
@Test
public void editable_when_project_configured() {
Project project = Project.of(new NameDescription("P", "Project")).withId(ID.of(1));
Branch branch = Branch.of(project, new NameDescription("B", "Branch")).withId(ID.of(1));
PropertyService propertiesService = mock(PropertyService.class);
when(propertiesService.hasProperty(project, SVNProjectConfigurationPropertyType.class)).thenReturn(true);
SecurityService securityService = mock(SecurityService.class);
when(securityService.isProjectFunctionGranted(1, ProjectConfig.class)).thenReturn(true);
BuildSvnRevisionLinkService buildSvnRevisionLinkService = mock(BuildSvnRevisionLinkService.class);
TagNameSvnRevisionLink tagNameSvnRevisionLink = new TagNameSvnRevisionLink(mock(SVNService.class), mock(StructureService.class));
SVNBranchConfigurationPropertyType propertyType = new SVNBranchConfigurationPropertyType(new SVNExtensionFeature(new SCMExtensionFeature()), propertiesService, buildSvnRevisionLinkService, tagNameSvnRevisionLink);
assertTrue(propertyType.canEdit(branch, securityService));
}
use of net.nemerosa.ontrack.extension.scm.SCMExtensionFeature in project ontrack by nemerosa.
the class SVNRevisionChangeLogIssueValidatorTest method fromStorage.
@Test
public void fromStorage() {
PropertyService propertyService = mock(PropertyService.class);
SVNIssueRevisionDao issueRevisionDao = mock(SVNIssueRevisionDao.class);
SVNRevisionChangeLogIssueValidator validator = new SVNRevisionChangeLogIssueValidator(new SVNExtensionFeature(new SCMExtensionFeature()), propertyService, issueRevisionDao);
assertEquals(new SVNRevisionChangeLogIssueValidatorConfig(Arrays.asList("Closed", "Resolved")), validator.fromStorage(JsonUtils.object().with("closedStatuses", JsonUtils.stringArray("Closed", "Resolved")).end()));
}
use of net.nemerosa.ontrack.extension.scm.SCMExtensionFeature 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");
}
Aggregations