use of com.epam.pipeline.entity.pipeline.ToolWithIssuesCount in project cloud-pipeline by epam.
the class ToolDaoTest method testLoadToolsWithIssuesCount.
@Test
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void testLoadToolsWithIssuesCount() {
// create tool
Tool tool = generateTool();
tool.setRegistryId(firstRegistry.getId());
tool.setToolGroupId(library1.getId());
toolDao.createTool(tool);
// create issues
when(authManager.getAuthorizedUser()).thenReturn(AUTHOR);
EntityVO entityVO = new EntityVO(tool.getId(), AclClass.TOOL);
IssueVO issueVO = getIssueVO(ISSUE_NAME, ISSUE_TEXT, entityVO);
issueManager.createIssue(issueVO);
verify(notificationManager).notifyIssue(any(), any(), any());
issueVO.setName(ISSUE_NAME2);
issueManager.createIssue(issueVO);
List<ToolWithIssuesCount> loaded = toolDao.loadToolsWithIssuesCountByGroup(library1.getId());
Assert.assertEquals(1, loaded.size());
Assert.assertEquals(2, loaded.get(0).getIssuesCount());
}
Aggregations