Class C4CTicketFacadeImplTest

    • Constructor Detail

      • C4CTicketFacadeImplTest

        public C4CTicketFacadeImplTest()
    • Method Detail

      • setup

        public void setup()
        Test setup.
      • shouldReturnRuntimeExceptionWhenThrowRestClientException

        public void shouldReturnRuntimeExceptionWhenThrowRestClientException()
                                                                      throws java.io.IOException
        Test of C4CTicketFacadeImpl.createTicket(TicketData) throws runtime exp. when RestClientException happens
        Throws:
        java.io.IOException
      • shouldReturnCustomerSupportTicketExceptionWhenThrowIOException

        public void shouldReturnCustomerSupportTicketExceptionWhenThrowIOException()
                                                                            throws java.io.IOException
        Test of C4CTicketFacadeImpl.createTicket(TicketData) Should return runtime exception when something happens
        Throws:
        java.io.IOException
      • shouldGetTicket

        public void shouldGetTicket()
                             throws java.io.IOException
        Test of C4CTicketFacadeImpl.getTicket(String) should get a ticket DTO by given ticket id.
        Throws:
        java.io.IOException
      • shouldReturnRuntimeExceptionWhenGetTicketThrowIOException

        public void shouldReturnRuntimeExceptionWhenGetTicketThrowIOException()
                                                                       throws java.io.IOException
        Test of C4CTicketFacadeImpl.getTicket(String) Should return runtime exception when something goes wrong
        Throws:
        java.io.IOException
      • shouldReturnRuntimeExceptionWhenGetTicketThrowRestClientException

        public void shouldReturnRuntimeExceptionWhenGetTicketThrowRestClientException()
                                                                               throws java.io.IOException
        Test of C4CTicketFacadeImpl.getTicket(String) Should return runtime exception when something goes wrong
        Throws:
        java.io.IOException
        java.lang.RuntimeException
      • shouldReturnEmptySearchResultWhenGetTicketsThrowIOException

        public void shouldReturnEmptySearchResultWhenGetTicketsThrowIOException()
                                                                         throws java.io.IOException
        Test of C4CTicketFacadeImpl.getTickets(PageableData) should return an empty result list if throw IOException.
        Throws:
        java.io.IOException
      • shouldReturnEmptySearchResultWhenGetTicketsThrowRestClientException

        public void shouldReturnEmptySearchResultWhenGetTicketsThrowRestClientException()
                                                                                 throws java.io.IOException
        Test of C4CTicketFacadeImpl.getTickets(PageableData) should return an empty result list if throw RestClientException.
        Throws:
        java.io.IOException
      • shouldCreateBasicAuthHeader

        public void shouldCreateBasicAuthHeader()
        Test of C4CTicketFacadeImpl#createBasicAuthHeader(String, String) Should create a correct basic auth header.
      • shouldGetDefaultHeaders

        public void shouldGetDefaultHeaders()
        Test of C4CTicketFacadeImpl#getDefaultHeaders(String) should get a correct default header by given site id.
      • shouldGetEnrichedHeaders

        public void shouldGetEnrichedHeaders()
        Test of C4CTicketFacadeImpl#getEnrichedHeaders() should return an enriched header.
      • shouldGetAssociatedToObjectsThrowUnsupportedOperationException

        public void shouldGetAssociatedToObjectsThrowUnsupportedOperationException()
        Test of C4CTicketFacadeImpl.getAssociatedToObjects() Should throw UnsupportedOperationException.
      • shouldGetTicketCategoriesThrowUnsupportedOperationException

        public void shouldGetTicketCategoriesThrowUnsupportedOperationException()
        Test of C4CTicketFacadeImpl.getTicketCategories() Should throw UnsupportedOperationException.
      • shouldAddBatchHeaders

        public void shouldAddBatchHeaders()
        Test o fC4CTicketFacadeImpl#addBatchHeaders(String) should return http headers which populated correctly data.
      • shouldEnrichHeaders

        public void shouldEnrichHeaders()
        Test of C4CTicketFacadeImpl#enrichHeaders(HttpHeaders, String) should return the enriched http headers with required data.
      • shouldThrownIllegalArgumentExceptionWhenUpdateTicketWithCompletedStatus

        public void shouldThrownIllegalArgumentExceptionWhenUpdateTicketWithCompletedStatus()
        Test of C4CTicketFacadeImpl.updateTicket(TicketData) should throw IllegalArgumentException when ticket is completed status.
      • shouldUpdateTicketWithOpenStatus

        public void shouldUpdateTicketWithOpenStatus()
                                              throws com.fasterxml.jackson.core.JsonProcessingException
        Test of C4CTicketFacadeImpl.updateTicket(TicketData) should update the ticket when the status is open.
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException
      • shouldReturnNullIfUpdateTicketWithOpenStatusResponseContainsError

        public void shouldReturnNullIfUpdateTicketWithOpenStatusResponseContainsError()
                                                                               throws com.fasterxml.jackson.core.JsonProcessingException
        Test of C4CTicketFacadeImpl.updateTicket(TicketData) should return null if update ticket with open status bu the response contains errors.
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException