Search in sources :

Example 1 with ConfigurationRepository

use of net.nemerosa.ontrack.model.support.ConfigurationRepository in project ontrack by nemerosa.

the class ConfigurationServiceTest method before.

@Before
public void before() {
    configurationRepository = mock(ConfigurationRepository.class);
    securityService = mock(SecurityService.class);
    encryptionService = mock(EncryptionService.class);
    eventPostService = mock(EventPostService.class);
    eventFactory = mock(EventFactory.class);
    OntrackConfigProperties ontrackConfigProperties = new OntrackConfigProperties();
    configurationService = new TestConfigurationServiceImpl(configurationRepository, securityService, encryptionService, eventPostService, eventFactory, ontrackConfigProperties);
}
Also used : SecurityService(net.nemerosa.ontrack.model.security.SecurityService) EncryptionService(net.nemerosa.ontrack.model.security.EncryptionService) EventPostService(net.nemerosa.ontrack.model.events.EventPostService) EventFactory(net.nemerosa.ontrack.model.events.EventFactory) TestConfigurationServiceImpl(net.nemerosa.ontrack.extension.api.support.TestConfigurationServiceImpl) ConfigurationRepository(net.nemerosa.ontrack.model.support.ConfigurationRepository) OntrackConfigProperties(net.nemerosa.ontrack.model.support.OntrackConfigProperties) Before(org.junit.Before)

Example 2 with ConfigurationRepository

use of net.nemerosa.ontrack.model.support.ConfigurationRepository in project ontrack by nemerosa.

the class JenkinsServiceTest method before.

@Before
public void before() {
    SecurityService securityService = mock(SecurityService.class);
    configurationRepository = mock(ConfigurationRepository.class);
    encryptionService = mock(EncryptionService.class);
    JenkinsClientFactory jenkinsClientFactory = mock(JenkinsClientFactory.class);
    JenkinsClient okJenkinsClient = mock(JenkinsClient.class);
    when(jenkinsClientFactory.getClient(any(JenkinsConfiguration.class))).thenReturn(okJenkinsClient);
    OntrackConfigProperties ontrackConfigProperties = new OntrackConfigProperties();
    jenkinsService = new JenkinsConfigurationServiceImpl(configurationRepository, securityService, encryptionService, mock(EventPostService.class), mock(EventFactory.class), jenkinsClientFactory, ontrackConfigProperties);
}
Also used : JenkinsClient(net.nemerosa.ontrack.extension.jenkins.client.JenkinsClient) SecurityService(net.nemerosa.ontrack.model.security.SecurityService) EncryptionService(net.nemerosa.ontrack.model.security.EncryptionService) JenkinsConfigurationServiceImpl(net.nemerosa.ontrack.extension.jenkins.JenkinsConfigurationServiceImpl) JenkinsClientFactory(net.nemerosa.ontrack.extension.jenkins.client.JenkinsClientFactory) ConfigurationRepository(net.nemerosa.ontrack.model.support.ConfigurationRepository) OntrackConfigProperties(net.nemerosa.ontrack.model.support.OntrackConfigProperties) JenkinsConfiguration(net.nemerosa.ontrack.extension.jenkins.JenkinsConfiguration) Before(org.junit.Before)

Example 3 with ConfigurationRepository

use of net.nemerosa.ontrack.model.support.ConfigurationRepository in project ontrack by nemerosa.

the class JIRAServiceTest method before.

@Before
public void before() {
    SecurityService securityService = mock(SecurityService.class);
    configurationRepository = mock(ConfigurationRepository.class);
    encryptionService = mock(EncryptionService.class);
    JIRASession jiraSession = mock(JIRASession.class);
    when(jiraSession.getClient()).thenReturn(mock(JIRAClient.class));
    JIRASessionFactory jiraSessionFactory = mock(JIRASessionFactory.class);
    when(jiraSessionFactory.create(any(JIRAConfiguration.class))).thenReturn(jiraSession);
    OntrackConfigProperties ontrackConfigProperties = new OntrackConfigProperties();
    jiraService = new JIRAConfigurationServiceImpl(configurationRepository, securityService, encryptionService, mock(EventPostService.class), mock(EventFactory.class), jiraSessionFactory, ontrackConfigProperties);
}
Also used : JIRAClient(net.nemerosa.ontrack.extension.jira.client.JIRAClient) JIRASession(net.nemerosa.ontrack.extension.jira.tx.JIRASession) SecurityService(net.nemerosa.ontrack.model.security.SecurityService) EncryptionService(net.nemerosa.ontrack.model.security.EncryptionService) ConfigurationRepository(net.nemerosa.ontrack.model.support.ConfigurationRepository) JIRASessionFactory(net.nemerosa.ontrack.extension.jira.tx.JIRASessionFactory) OntrackConfigProperties(net.nemerosa.ontrack.model.support.OntrackConfigProperties) Before(org.junit.Before)

Aggregations

EncryptionService (net.nemerosa.ontrack.model.security.EncryptionService)3 SecurityService (net.nemerosa.ontrack.model.security.SecurityService)3 ConfigurationRepository (net.nemerosa.ontrack.model.support.ConfigurationRepository)3 OntrackConfigProperties (net.nemerosa.ontrack.model.support.OntrackConfigProperties)3 Before (org.junit.Before)3 TestConfigurationServiceImpl (net.nemerosa.ontrack.extension.api.support.TestConfigurationServiceImpl)1 JenkinsConfiguration (net.nemerosa.ontrack.extension.jenkins.JenkinsConfiguration)1 JenkinsConfigurationServiceImpl (net.nemerosa.ontrack.extension.jenkins.JenkinsConfigurationServiceImpl)1 JenkinsClient (net.nemerosa.ontrack.extension.jenkins.client.JenkinsClient)1 JenkinsClientFactory (net.nemerosa.ontrack.extension.jenkins.client.JenkinsClientFactory)1 JIRAClient (net.nemerosa.ontrack.extension.jira.client.JIRAClient)1 JIRASession (net.nemerosa.ontrack.extension.jira.tx.JIRASession)1 JIRASessionFactory (net.nemerosa.ontrack.extension.jira.tx.JIRASessionFactory)1 EventFactory (net.nemerosa.ontrack.model.events.EventFactory)1 EventPostService (net.nemerosa.ontrack.model.events.EventPostService)1