use of com.epam.ta.reportportal.pipeline.PipelinePart 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.pipeline.PipelinePart 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.pipeline.PipelinePart 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);
}
use of com.epam.ta.reportportal.pipeline.PipelinePart in project service-api by reportportal.
the class SaveClusterDataPartProviderTest method shouldNotSaveWhenNoDataExists.
@Test
void shouldNotSaveWhenNoDataExists() {
final GenerateClustersConfig config = getConfig(false);
when(dataProvider.provide(config)).thenReturn(Optional.empty());
final PipelinePart pipelinePart = provider.provide(config);
pipelinePart.handle();
verify(createClusterHandler, times(0)).create(any(ClusterData.class));
}
use of com.epam.ta.reportportal.pipeline.PipelinePart in project service-api by reportportal.
the class SaveLastRunAttributePartProviderTest method shouldSaveWhenNotExists.
@Test
void shouldSaveWhenNotExists() {
final GenerateClustersConfig config = getConfig(false);
when(itemAttributeRepository.findByLaunchIdAndKeyAndSystem(config.getLaunchId(), RP_CLUSTER_LAST_RUN_KEY, true)).thenReturn(Optional.empty());
final PipelinePart pipelinePart = provider.provide(config);
pipelinePart.handle();
verify(itemAttributeRepository, times(1)).saveByLaunchId(eq(config.getLaunchId()), eq(RP_CLUSTER_LAST_RUN_KEY), anyString(), eq(true));
}
Aggregations