Search in sources :

Example 16 with IssueVO

use of com.epam.pipeline.controller.vo.IssueVO in project cloud-pipeline by epam.

the class IssueManagerTest method creatingIssueForNonExistentEntityShouldThrowException.

@Test(expected = IllegalArgumentException.class)
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void creatingIssueForNonExistentEntityShouldThrowException() {
    when(authManager.getAuthorizedUser()).thenReturn(AUTHOR);
    Long nonExistentEntityId = 1L;
    EntityVO nonExistentEntity = new EntityVO(nonExistentEntityId, AclClass.PIPELINE);
    IssueVO issueVO = getIssueVO(ISSUE_NAME, ISSUE_TEXT, nonExistentEntity);
    issueManager.createIssue(issueVO);
    verify(notificationManager, Mockito.never()).notifyIssue(any(), any(), any());
}
Also used : EntityVO(com.epam.pipeline.controller.vo.EntityVO) IssueVO(com.epam.pipeline.controller.vo.IssueVO) AbstractSpringTest(com.epam.pipeline.AbstractSpringTest) Test(org.junit.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

IssueVO (com.epam.pipeline.controller.vo.IssueVO)16 Transactional (org.springframework.transaction.annotation.Transactional)11 AbstractSpringTest (com.epam.pipeline.AbstractSpringTest)10 Test (org.junit.Test)10 Issue (com.epam.pipeline.entity.issue.Issue)9 EntityVO (com.epam.pipeline.controller.vo.EntityVO)5 IssueCommentVO (com.epam.pipeline.controller.vo.IssueCommentVO)2 AttachmentDao (com.epam.pipeline.dao.issue.AttachmentDao)2 Attachment (com.epam.pipeline.entity.issue.Attachment)2 IssueComment (com.epam.pipeline.entity.issue.IssueComment)2 IssueStatus (com.epam.pipeline.entity.issue.IssueStatus)2 Folder (com.epam.pipeline.entity.pipeline.Folder)2 AclClass (com.epam.pipeline.entity.security.acl.AclClass)2 NotificationManager (com.epam.pipeline.manager.notification.NotificationManager)2 AuthManager (com.epam.pipeline.manager.security.AuthManager)2 IssueMapper (com.epam.pipeline.mapper.IssueMapper)2 Collections (java.util.Collections)2 List (java.util.List)2 Map (java.util.Map)2 Collectors (java.util.stream.Collectors)2