use of net.nemerosa.ontrack.extension.gitlab.model.GitLabConfiguration in project ontrack by nemerosa.
the class GitLabConfigurationTest method cloneTest.
@Test
public void cloneTest() {
GitLabConfiguration cloned = configurationFixture().clone("newConfig", s -> StringUtils.replace(s, "nemerosa", "other"));
assertEquals("newConfig", cloned.getName());
assertEquals("https://gitlab.other.net", cloned.getUrl());
assertEquals("test", cloned.getUser());
assertEquals("1234567890abcdef", cloned.getPassword());
assertFalse(cloned.isIgnoreSslCertificate());
}
use of net.nemerosa.ontrack.extension.gitlab.model.GitLabConfiguration in project ontrack by nemerosa.
the class GitLabConfigurationTest method obfuscate.
@Test
public void obfuscate() {
GitLabConfiguration obfuscate = configurationFixture().obfuscate();
assertEquals("", obfuscate.getPassword());
}
use of net.nemerosa.ontrack.extension.gitlab.model.GitLabConfiguration 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.GitLabConfiguration 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.GitLabConfiguration in project ontrack by nemerosa.
the class GitLabProjectConfigurationPropertyType method fromStorage.
@Override
public GitLabProjectConfigurationProperty fromStorage(JsonNode node) {
String configurationName = node.path("configuration").asText();
// Looks the configuration up
GitLabConfiguration configuration = configurationService.getConfiguration(configurationName);
// OK
return new GitLabProjectConfigurationProperty(configuration, node.path("issueServiceConfigurationIdentifier").asText(), node.path("repository").asText(), node.path("indexationInterval").asInt());
}
Aggregations