Class CustomerTicketingFacadeTest
-
Constructor Details
-
CustomerTicketingFacadeTest
public CustomerTicketingFacadeTest()
-
-
Method Details
-
setup
public void setup()Test seutp. -
cleanUp
- Throws:
Exception
-
shouldReturnAssociatedObjectMapForCurrentUser
public void shouldReturnAssociatedObjectMapForCurrentUser()Test ofDefaultCustomerTicketingFacade.getAssociatedToObjects()should return the associate object map which contents 2 TicketAssociatedData.
-
shouldReturnAssociatedObjectMapForCurrentUserAndSiteId
public void shouldReturnAssociatedObjectMapForCurrentUserAndSiteId()Test ofDefaultCustomerTicketingFacade.getAssociatedToObjects()should return the associate object map which siteId is `current`.
-
shouldReturnCsStatusNew
public void shouldReturnCsStatusNew()Test ofDefaultCustomerTicketingFacade.getCsStatus(TicketData)should return CsTicketStatus.NEW
-
shouldReturnCsStatusOpen
public void shouldReturnCsStatusOpen()Test ofDefaultCustomerTicketingFacade.getCsStatus(TicketData)should return CsTicketStatus.OPEN
-
shouldReturnCsStatusClose
public void shouldReturnCsStatusClose()Test ofDefaultCustomerTicketingFacade.getCsStatus(TicketData)should return CsTicketStatus.CLOSED
-
shouldReturnNullIfNoMatchCsStatus
public void shouldReturnNullIfNoMatchCsStatus()Test ofDefaultCustomerTicketingFacade.getCsStatus(TicketData)should return NULL value if no match status found.
-
shouldReturnNullOfAttachments
public void shouldReturnNullOfAttachments()Test ofDefaultCustomerTicketingFacade.getAttachments(TicketData)should return NULL value if no attachments in ticket data.
-
shouldReturnListOfAttachments
Test ofDefaultCustomerTicketingFacade.getAttachments(TicketData)should return list of attachments which contents 2 media models.
- Throws:
IOException
-
shouldReturnNullOfAttachmentsIfIOException
Test ofDefaultCustomerTicketingFacade.getAttachments(TicketData)should return NULL value if an IOException occurs
- Throws:
IOException
-
shouldUpdateTicketWithNewNote
public void shouldUpdateTicketWithNewNote()Test ofDefaultCustomerTicketingFacade.updateTicket(TicketData)should invoke
TicketBusinessService.addNoteToTicket(CsTicketModel, CsInterventionType, CsEventReason, String, Collection)when ticket is NEW state and in OPEN status. -
shouldUpdateTicketStatusFromOpenToClose
Test ofDefaultCustomerTicketingFacade.updateTicket(TicketData)should invoke
TicketBusinessService.resolveTicket(CsTicketModel, CsInterventionType, CsResolutionType, String, Collection)when ticket status transit from OPEN to CLOSE- Throws:
TicketException
-
shouldUpdateTicketStatusFromOpenToInProgress
Test ofDefaultCustomerTicketingFacade.updateTicket(TicketData)should invoke
TicketBusinessService.unResolveTicket(CsTicketModel, CsInterventionType, CsEventReason, String, Collection)when ticket status transit from NEW to INPROCESS- Throws:
TicketException
-
shouldThrowExceptionWhenAssociatedObjInvalid
public void shouldThrowExceptionWhenAssociatedObjInvalid()Test ofDefaultCustomerTicketingFacade.createTicket(TicketData)should throw BadRequestException if associated object is invalid.
- Throws:
javax.ws.rs.BadRequestException
-
shouldCreateAttachmentModel
Test ofDefaultCustomerTicketingFacade.createAttachmentModel(MultipartFile)should invoke
TicketAttachmentsService.createAttachment(String, String, byte[], UserModel)should return the media model of the newly created attachment.
- Throws:
IOException
-
shouldAddAttachmentToEventByEventCode
Test ofDefaultCustomerTicketingFacade.addAttachmentToEventByEventCode(String, String, MultipartFile)should invoke
TicketBusinessService.addAttachmentToNote(CsTicketModel, CsCustomerEventModel, MediaModel)should return the
TicketEventDataobject of the newly updated event.- Throws:
IOException
-
shouldThrowExceptionWhenTicketIdDoesNotExist
Test ofDefaultCustomerTicketingFacade.addAttachmentToEventByEventCode(String, String, MultipartFile)should throw RuntimeException if ticket id does not exist.
- Throws:
RuntimeExceptionIOException
-
shouldThrowExceptionWhenEventCodeDoesNotExist
Test ofDefaultCustomerTicketingFacade.addAttachmentToEventByEventCode(String, String, MultipartFile)should throw RuntimeException if event code does not exist.
- Throws:
RuntimeExceptionIOException
-