Search in sources :

Example 1 with PipelinePart

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());
}
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 2 with PipelinePart

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());
}
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 3 with PipelinePart

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

Example 4 with PipelinePart

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

Example 5 with PipelinePart

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

Aggregations

GenerateClustersConfig (com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.GenerateClustersConfig)6 PipelinePart (com.epam.ta.reportportal.pipeline.PipelinePart)6 Test (org.junit.jupiter.api.Test)6 ClusterData (com.epam.ta.reportportal.core.analyzer.auto.client.model.cluster.ClusterData)2 ItemAttribute (com.epam.ta.reportportal.entity.ItemAttribute)1