use of com.epam.pipeline.controller.vo.PagingRunFilterVO in project cloud-pipeline by epam.
the class PipelineRunDaoTest method testLoadActiveServicesByOwner.
@Test
public void testLoadActiveServicesByOwner() {
PipelineRun run = createTestPipelineRun();
PagingRunFilterVO filterVO = new PagingRunFilterVO();
filterVO.setPage(1);
filterVO.setPageSize(TEST_PAGE_SIZE);
PipelineUser user = new PipelineUser();
user.setUserName(USER);
List<PipelineRun> runs = pipelineRunDao.loadActiveServices(filterVO, user);
assertEquals(1, runs.size());
assertEquals(run.getId(), runs.get(0).getId());
assertEquals(1, runs.size());
}
use of com.epam.pipeline.controller.vo.PagingRunFilterVO in project cloud-pipeline by epam.
the class PipelineRunManagerTest method testResolveProjectFiltering.
@Test
@WithMockUser(roles = "ADMIN")
public void testResolveProjectFiltering() {
Folder project = new Folder();
project.setId(1L);
Folder child = new Folder();
project.setId(2L);
project.getChildFolders().add(child);
Pipeline pipeline1 = new Pipeline();
pipeline1.setId(2L);
project.getPipelines().add(pipeline1);
Pipeline pipeline2 = new Pipeline();
pipeline2.setId(3L);
child.getPipelines().add(pipeline2);
RunConfiguration configuration1 = new RunConfiguration();
configuration1.setId(4L);
project.getConfigurations().add(configuration1);
RunConfiguration configuration2 = new RunConfiguration();
configuration2.setId(5L);
child.getConfigurations().add(configuration2);
when(folderManager.load(project.getId())).thenReturn(project);
PagingRunFilterVO filterVO = new PagingRunFilterVO();
filterVO.setProjectIds(Collections.singletonList(project.getId()));
PipelineRunFilterVO.ProjectFilter projectFilter = pipelineRunManager.resolveProjectFiltering(filterVO);
Assert.assertEquals(2, projectFilter.getPipelineIds().size());
Assert.assertEquals(2, projectFilter.getConfigurationIds().size());
}
Aggregations