Search in sources :

Example 1 with GenerateClustersConfig

use of com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersConfig in project service-api by reportportal.

the class AnalyzerClusterDataProviderTest method shouldFailWhenNoAnalyzer.

@Test
void shouldFailWhenNoAnalyzer() {
    when(analyzerServiceClient.hasClients()).thenReturn(false);
    final GenerateClustersConfig config = getConfig(false);
    final ReportPortalException exception = assertThrows(ReportPortalException.class, () -> provider.provide(config));
    assertEquals("Impossible interact with integration. There are no analyzer services are deployed.", exception.getMessage());
}
Also used : ReportPortalException(com.epam.ta.reportportal.exception.ReportPortalException) GenerateClustersConfig(com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersConfig) Test(org.junit.jupiter.api.Test)

Example 2 with GenerateClustersConfig

use of com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersConfig in project service-api by reportportal.

the class AnalyzerClusterDataProviderTest method shouldReturnDataWhenNoIndexLaunch.

@Test
void shouldReturnDataWhenNoIndexLaunch() {
    when(analyzerServiceClient.hasClients()).thenReturn(true);
    final GenerateClustersConfig config = getConfig(false);
    when(launchPreparerService.prepare(config.getLaunchId(), config.getAnalyzerConfig())).thenReturn(Optional.of(new IndexLaunch()));
    when(analyzerServiceClient.generateClusters(any(GenerateClustersRq.class))).thenReturn(new ClusterData());
    final Optional<ClusterData> data = provider.provide(config);
    assertTrue(data.isPresent());
}
Also used : GenerateClustersRq(com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersRq) ClusterData(com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.ClusterData) IndexLaunch(com.epam.ta.reportportal.ws.model.analyzer.IndexLaunch) GenerateClustersConfig(com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersConfig) Test(org.junit.jupiter.api.Test)

Example 3 with GenerateClustersConfig

use of com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersConfig in project service-api by reportportal.

the class DeleteClustersPartProviderTest method shouldNotDeleteWhenForUpdate.

@Test
void shouldNotDeleteWhenForUpdate() {
    final GenerateClustersConfig config = getConfig(true);
    final PipelinePart pipelinePart = provider.provide(config);
    pipelinePart.handle();
    verify(logRepository, times(0)).updateClusterIdSetNullByLaunchId(config.getLaunchId());
    verify(clusterRepository, times(0)).deleteClusterTestItemsByLaunchId(config.getLaunchId());
    verify(clusterRepository, times(0)).deleteAllByLaunchId(config.getLaunchId());
}
Also used : PipelinePart(com.epam.ta.reportportal.pipeline.PipelinePart) GenerateClustersConfig(com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersConfig) Test(org.junit.jupiter.api.Test)

Example 4 with GenerateClustersConfig

use of com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersConfig in project service-api by reportportal.

the class DeleteClustersPartProviderTest method shouldDeleteWhenNotForUpdate.

@Test
void shouldDeleteWhenNotForUpdate() {
    final GenerateClustersConfig config = getConfig(false);
    final PipelinePart pipelinePart = provider.provide(config);
    pipelinePart.handle();
    verify(logRepository, times(1)).updateClusterIdSetNullByLaunchId(config.getLaunchId());
    verify(clusterRepository, times(1)).deleteClusterTestItemsByLaunchId(config.getLaunchId());
    verify(clusterRepository, times(1)).deleteAllByLaunchId(config.getLaunchId());
}
Also used : PipelinePart(com.epam.ta.reportportal.pipeline.PipelinePart) GenerateClustersConfig(com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersConfig) Test(org.junit.jupiter.api.Test)

Example 5 with GenerateClustersConfig

use of com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersConfig in project service-api by reportportal.

the class SaveClusterDataPartProviderTest method shouldSaveWhenDataExists.

@Test
void shouldSaveWhenDataExists() {
    final GenerateClustersConfig config = getConfig(false);
    final ClusterData clusterData = new ClusterData();
    when(dataProvider.provide(config)).thenReturn(Optional.of(clusterData));
    final PipelinePart pipelinePart = provider.provide(config);
    pipelinePart.handle();
    verify(createClusterHandler, times(1)).create(clusterData);
}
Also used : ClusterData(com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.ClusterData) PipelinePart(com.epam.ta.reportportal.pipeline.PipelinePart) GenerateClustersConfig(com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersConfig) Test(org.junit.jupiter.api.Test)

Aggregations

GenerateClustersConfig (com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersConfig)13 Test (org.junit.jupiter.api.Test)11 PipelinePart (com.epam.ta.reportportal.pipeline.PipelinePart)6 ClusterData (com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.ClusterData)4 Launch (com.epam.ta.reportportal.entity.launch.Launch)2 Project (com.epam.ta.reportportal.entity.project.Project)2 ReportPortalException (com.epam.ta.reportportal.exception.ReportPortalException)2 AnalyzerConfig (com.epam.ta.reportportal.ws.model.project.AnalyzerConfig)2 ReportPortalUser (com.epam.ta.reportportal.commons.ReportPortalUser)1 GenerateClustersRq (com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersRq)1 AnalyzerUtils.getAnalyzerConfig (com.epam.ta.reportportal.core.analyzer.auto.impl.AnalyzerUtils.getAnalyzerConfig)1 LaunchTestUtil.getLaunch (com.epam.ta.reportportal.core.launch.impl.LaunchTestUtil.getLaunch)1 ItemAttribute (com.epam.ta.reportportal.entity.ItemAttribute)1 TestProjectExtractor.extractProjectDetails (com.epam.ta.reportportal.util.TestProjectExtractor.extractProjectDetails)1 OperationCompletionRS (com.epam.ta.reportportal.ws.model.OperationCompletionRS)1 IndexLaunch (com.epam.ta.reportportal.ws.model.analyzer.IndexLaunch)1 CreateClustersRQ (com.epam.ta.reportportal.ws.model.launch.cluster.CreateClustersRQ)1 Transactional (org.springframework.transaction.annotation.Transactional)1