Class C4CTicketFacadeImplTest
- java.lang.Object
-
- de.hybris.platform.testframework.HybrisJUnit4Test
-
- de.hybris.platform.servicelayer.ServicelayerBaseTest
-
- de.hybris.platform.servicelayer.ServicelayerTest
-
- de.hybris.platform.customerticketingc4cintegration.facade.C4CTicketFacadeImplTest
-
- All Implemented Interfaces:
JaloSessionHolder
public class C4CTicketFacadeImplTest extends ServicelayerTest
Test cases forC4CTicketFacadeImpl
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.servicelayer.ServicelayerTest
importService
-
Fields inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
jaloSession
-
-
Constructor Summary
Constructors Constructor Description C4CTicketFacadeImplTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsetup()Test setup.voidshouldAddBatchHeaders()Test o fC4CTicketFacadeImpl#addBatchHeaders(String)should return http headers which populated correctly data.voidshouldCreateATicket()TestC4CTicketFacadeImpl.createTicket(TicketData)Should create a ticket.voidshouldCreateBasicAuthHeader()Test ofC4CTicketFacadeImpl#createBasicAuthHeader(String, String)Should create a correct basic auth header.voidshouldEnrichHeaders()Test ofC4CTicketFacadeImpl#enrichHeaders(HttpHeaders, String)should return the enriched http headers with required data.voidshouldGetAssociatedToObjectsThrowUnsupportedOperationException()Test ofC4CTicketFacadeImpl.getAssociatedToObjects()Should throw UnsupportedOperationException.voidshouldGetDefaultHeaders()Test ofC4CTicketFacadeImpl#getDefaultHeaders(String)should get a correct default header by given site id.voidshouldGetEnrichedHeaders()Test ofC4CTicketFacadeImpl#getEnrichedHeaders()should return an enriched header.voidshouldGetTicket()Test ofC4CTicketFacadeImpl.getTicket(String)should get a ticket DTO by given ticket id.voidshouldGetTicketCategoriesThrowUnsupportedOperationException()Test ofC4CTicketFacadeImpl.getTicketCategories()Should throw UnsupportedOperationException.voidshouldGetTickets()Test ofC4CTicketFacadeImpl.getTickets(PageableData)should return a SearchPageDataresult. voidshouldReturnCustomerSupportTicketExceptionWhenThrowIOException()Test ofC4CTicketFacadeImpl.createTicket(TicketData)Should return runtime exception when something happensvoidshouldReturnEmptySearchResultWhenGetTicketsThrowIOException()Test ofC4CTicketFacadeImpl.getTickets(PageableData)should return an empty result list if throw IOException.voidshouldReturnEmptySearchResultWhenGetTicketsThrowRestClientException()Test ofC4CTicketFacadeImpl.getTickets(PageableData)should return an empty result list if throw RestClientException.voidshouldReturnNullIfUpdateTicketWithOpenStatusResponseContainsError()Test ofC4CTicketFacadeImpl.updateTicket(TicketData)should return null if update ticket with open status bu the response contains errors.voidshouldReturnRuntimeExceptionWhenGetTicketThrowIOException()Test ofC4CTicketFacadeImpl.getTicket(String)Should return runtime exception when something goes wrongvoidshouldReturnRuntimeExceptionWhenGetTicketThrowRestClientException()Test ofC4CTicketFacadeImpl.getTicket(String)Should return runtime exception when something goes wrongvoidshouldReturnRuntimeExceptionWhenThrowRestClientException()Test ofC4CTicketFacadeImpl.createTicket(TicketData)throws runtime exp.voidshouldThrownIllegalArgumentExceptionWhenUpdateTicketWithCompletedStatus()Test ofC4CTicketFacadeImpl.updateTicket(TicketData)should throw IllegalArgumentException when ticket is completed status.voidshouldUpdateTicketWithOpenStatus()Test ofC4CTicketFacadeImpl.updateTicket(TicketData)should update the ticket when the status is open.-
Methods inherited from class de.hybris.platform.servicelayer.ServicelayerTest
createCoreData, createDefaultCatalog, createDefaultUsers, createHardwareCatalog, getApplicationContext, importCsv, importData, importData, importData, importStream, importStream, isPrefetchModeNone
-
Methods inherited from class de.hybris.platform.servicelayer.ServicelayerBaseTest
autowireProperties, getBeanName, prepareApplicationContextAndSession
-
Methods inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
establishJaloSession, finish, getOrCreateCurrency, getOrCreateLanguage, init, intenseChecksActivated, takeJaloSession
-
-
-
-
Method Detail
-
setup
public void setup()
Test setup.
-
shouldCreateATicket
public void shouldCreateATicket() throws java.io.IOExceptionTestC4CTicketFacadeImpl.createTicket(TicketData)Should create a ticket.- Throws:
java.io.IOException
-
shouldReturnRuntimeExceptionWhenThrowRestClientException
public void shouldReturnRuntimeExceptionWhenThrowRestClientException() throws java.io.IOExceptionTest ofC4CTicketFacadeImpl.createTicket(TicketData)throws runtime exp. when RestClientException happens- Throws:
java.io.IOException
-
shouldReturnCustomerSupportTicketExceptionWhenThrowIOException
public void shouldReturnCustomerSupportTicketExceptionWhenThrowIOException() throws java.io.IOExceptionTest ofC4CTicketFacadeImpl.createTicket(TicketData)Should return runtime exception when something happens- Throws:
java.io.IOException
-
shouldGetTicket
public void shouldGetTicket() throws java.io.IOExceptionTest ofC4CTicketFacadeImpl.getTicket(String)should get a ticket DTO by given ticket id.- Throws:
java.io.IOException
-
shouldReturnRuntimeExceptionWhenGetTicketThrowIOException
public void shouldReturnRuntimeExceptionWhenGetTicketThrowIOException() throws java.io.IOExceptionTest ofC4CTicketFacadeImpl.getTicket(String)Should return runtime exception when something goes wrong- Throws:
java.io.IOException
-
shouldReturnRuntimeExceptionWhenGetTicketThrowRestClientException
public void shouldReturnRuntimeExceptionWhenGetTicketThrowRestClientException() throws java.io.IOExceptionTest ofC4CTicketFacadeImpl.getTicket(String)Should return runtime exception when something goes wrong- Throws:
java.io.IOExceptionjava.lang.RuntimeException
-
shouldGetTickets
public void shouldGetTickets() throws java.io.IOExceptionTest ofC4CTicketFacadeImpl.getTickets(PageableData)should return a SearchPageDataresult. - Throws:
java.io.IOException
-
shouldReturnEmptySearchResultWhenGetTicketsThrowIOException
public void shouldReturnEmptySearchResultWhenGetTicketsThrowIOException() throws java.io.IOExceptionTest ofC4CTicketFacadeImpl.getTickets(PageableData)should return an empty result list if throw IOException.- Throws:
java.io.IOException
-
shouldReturnEmptySearchResultWhenGetTicketsThrowRestClientException
public void shouldReturnEmptySearchResultWhenGetTicketsThrowRestClientException() throws java.io.IOExceptionTest ofC4CTicketFacadeImpl.getTickets(PageableData)should return an empty result list if throw RestClientException.- Throws:
java.io.IOException
-
shouldCreateBasicAuthHeader
public void shouldCreateBasicAuthHeader()
Test ofC4CTicketFacadeImpl#createBasicAuthHeader(String, String)Should create a correct basic auth header.
-
shouldGetDefaultHeaders
public void shouldGetDefaultHeaders()
Test ofC4CTicketFacadeImpl#getDefaultHeaders(String)should get a correct default header by given site id.
-
shouldGetEnrichedHeaders
public void shouldGetEnrichedHeaders()
Test ofC4CTicketFacadeImpl#getEnrichedHeaders()should return an enriched header.
-
shouldGetAssociatedToObjectsThrowUnsupportedOperationException
public void shouldGetAssociatedToObjectsThrowUnsupportedOperationException()
Test ofC4CTicketFacadeImpl.getAssociatedToObjects()Should throw UnsupportedOperationException.
-
shouldGetTicketCategoriesThrowUnsupportedOperationException
public void shouldGetTicketCategoriesThrowUnsupportedOperationException()
Test ofC4CTicketFacadeImpl.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 ofC4CTicketFacadeImpl#enrichHeaders(HttpHeaders, String)should return the enriched http headers with required data.
-
shouldThrownIllegalArgumentExceptionWhenUpdateTicketWithCompletedStatus
public void shouldThrownIllegalArgumentExceptionWhenUpdateTicketWithCompletedStatus()
Test ofC4CTicketFacadeImpl.updateTicket(TicketData)should throw IllegalArgumentException when ticket is completed status.
-
shouldUpdateTicketWithOpenStatus
public void shouldUpdateTicketWithOpenStatus() throws com.fasterxml.jackson.core.JsonProcessingExceptionTest ofC4CTicketFacadeImpl.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.JsonProcessingExceptionTest ofC4CTicketFacadeImpl.updateTicket(TicketData)should return null if update ticket with open status bu the response contains errors.- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
-