Search in sources :

Example 16 with AnalyzerConfig

use of com.epam.ta.reportportal.ws.model.project.AnalyzerConfig in project service-api by reportportal.

the class LogIndexerServiceTest method testIndexDefectsUpdate.

@Test
void testIndexDefectsUpdate() {
    final Map<Long, String> toUpdate = Maps.newHashMap(1L, "pb001");
    when(indexerServiceClient.indexDefectsUpdate(1L, toUpdate)).thenReturn(Collections.emptyList());
    logIndexerService.indexDefectsUpdate(1L, new AnalyzerConfig(), Lists.newArrayList(createTestItem(1L, TestItemIssueGroup.PRODUCT_BUG)));
    verify(indexerServiceClient, times(1)).indexDefectsUpdate(1L, toUpdate);
}
Also used : AnalyzerConfig(com.epam.ta.reportportal.ws.model.project.AnalyzerConfig) Test(org.junit.jupiter.api.Test)

Example 17 with AnalyzerConfig

use of com.epam.ta.reportportal.ws.model.project.AnalyzerConfig in project service-api by reportportal.

the class LaunchPreparerServiceImplTest method prepare.

@Test
void prepare() {
    final long launchId = 1L;
    final IndexLaunch indexLaunch = new IndexLaunch();
    indexLaunch.setLaunchId(launchId);
    indexLaunch.setLaunchName("name");
    indexLaunch.setProjectId(1L);
    when(launchRepository.findIndexLaunchByIdsAndLogLevel(eq(List.of(launchId)), anyInt())).thenReturn(List.of(indexLaunch));
    final IndexTestItem indexTestItem = new IndexTestItem();
    when(testItemPreparerService.prepare(indexLaunch.getLaunchId())).thenReturn(List.of(indexTestItem));
    final Cluster cluster = new Cluster();
    cluster.setIndexId(1L);
    cluster.setMessage("hello");
    when(clusterRepository.findAllByLaunchId(indexLaunch.getLaunchId())).thenReturn(List.of(cluster));
    final AnalyzerConfig analyzerConfig = new AnalyzerConfig();
    preparerService.prepare(List.of(launchId), analyzerConfig);
}
Also used : IndexLaunch(com.epam.ta.reportportal.ws.model.analyzer.IndexLaunch) AnalyzerConfig(com.epam.ta.reportportal.ws.model.project.AnalyzerConfig) IndexTestItem(com.epam.ta.reportportal.ws.model.analyzer.IndexTestItem) Cluster(com.epam.ta.reportportal.entity.cluster.Cluster) Test(org.junit.jupiter.api.Test)

Example 18 with AnalyzerConfig

use of com.epam.ta.reportportal.ws.model.project.AnalyzerConfig in project service-api by reportportal.

the class BatchLogIndexerTest method analyzerConfig.

private AnalyzerConfig analyzerConfig() {
    AnalyzerConfig analyzerConfig = new AnalyzerConfig();
    analyzerConfig.setAnalyzerMode(ALL_LAUNCHES.getValue());
    return analyzerConfig;
}
Also used : AnalyzerConfig(com.epam.ta.reportportal.ws.model.project.AnalyzerConfig)

Aggregations

AnalyzerConfig (com.epam.ta.reportportal.ws.model.project.AnalyzerConfig)18 IndexLaunch (com.epam.ta.reportportal.ws.model.analyzer.IndexLaunch)6 Test (org.junit.jupiter.api.Test)6 Launch (com.epam.ta.reportportal.entity.launch.Launch)5 ReportPortalException (com.epam.ta.reportportal.exception.ReportPortalException)5 Project (com.epam.ta.reportportal.entity.project.Project)4 Transactional (org.springframework.transaction.annotation.Transactional)4 LaunchPreparerService (com.epam.ta.reportportal.core.analyzer.auto.impl.preparer.LaunchPreparerService)3 TestItemRepository (com.epam.ta.reportportal.dao.TestItemRepository)3 TestItem (com.epam.ta.reportportal.entity.item.TestItem)3 IndexTestItem (com.epam.ta.reportportal.ws.model.analyzer.IndexTestItem)3 Collectors (java.util.stream.Collectors)3 Async (org.springframework.scheduling.annotation.Async)3 LogIndexer (com.epam.ta.reportportal.core.analyzer.auto.LogIndexer)2 IndexerServiceClient (com.epam.ta.reportportal.core.analyzer.auto.client.IndexerServiceClient)2 GenerateClustersConfig (com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersConfig)2 AnalyzerUtils.getAnalyzerConfig (com.epam.ta.reportportal.core.analyzer.auto.impl.AnalyzerUtils.getAnalyzerConfig)2 BatchLogIndexer (com.epam.ta.reportportal.core.analyzer.auto.indexer.BatchLogIndexer)2 IndexerStatusCache (com.epam.ta.reportportal.core.analyzer.auto.indexer.IndexerStatusCache)2 LaunchRepository (com.epam.ta.reportportal.dao.LaunchRepository)2