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());
}
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());
}
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());
}
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());
}
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);
}
Aggregations