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:
de.hybris.platform.testframework.JaloSessionHolder
@UnitTest public class C4CTicketFacadeImplTest extends de.hybris.platform.servicelayer.ServicelayerTestTest cases forC4CTicketFacadeImpl
-
-
Constructor Summary
Constructors Constructor Description C4CTicketFacadeImplTest()
-
Method Summary
-
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
-
-
-
-
Method Detail
-
setup
public void setup() throws C4CServiceExceptionTest setup.- Throws:
C4CServiceException
-
shouldCreateATicket
public void shouldCreateATicket() throws C4CServiceExceptionTestC4CTicketFacadeImpl.createTicket(TicketData)Should create a ticket.- Throws:
java.io.IOExceptionC4CServiceException
-
shouldReturnRuntimeExceptionWhenThrowRestClientException
public void shouldReturnRuntimeExceptionWhenThrowRestClientException() throws C4CServiceExceptionTest ofC4CTicketFacadeImpl.createTicket(TicketData)throws runtime exp. when RestClientException happens- Throws:
java.io.IOExceptionC4CServiceException
-
shouldGetTicket
public void shouldGetTicket() throws C4CServiceExceptionTest ofC4CTicketFacadeImpl.getTicket(String)should get a ticket DTO by given ticket id.- Throws:
java.io.IOExceptionC4CServiceException
-
shouldReturnRuntimeExceptionWhenGetTicketThrowIOException
public void shouldReturnRuntimeExceptionWhenGetTicketThrowIOException() throws C4CServiceExceptionTest ofC4CTicketFacadeImpl.getTicket(String)Should return runtime exception when something goes wrong- Throws:
java.io.IOExceptionC4CServiceException
-
shouldReturnRuntimeExceptionWhenGetTicketThrowRestClientException
public void shouldReturnRuntimeExceptionWhenGetTicketThrowRestClientException() throws C4CServiceExceptionTest ofC4CTicketFacadeImpl.getTicket(String)Should return runtime exception when something goes wrong- Throws:
java.io.IOExceptionjava.lang.RuntimeExceptionC4CServiceException
-
shouldGetTickets
public void shouldGetTickets() throws C4CServiceExceptionTest ofC4CTicketFacadeImpl.getTickets(PageableData)should return a SearchPageDataresult. - Throws:
java.io.IOExceptionC4CServiceException
-
shouldReturnEmptySearchResultWhenGetTicketsThrowRestClientException
public void shouldReturnEmptySearchResultWhenGetTicketsThrowRestClientException() throws C4CServiceExceptionTest ofC4CTicketFacadeImpl.getTickets(PageableData)should return an empty result list if throw IOException.- Throws:
java.io.IOExceptionC4CServiceException
-
shouldCreateBasicAuthHeader
public void shouldCreateBasicAuthHeader()
Test ofHttpHeaderUtil.createBasicAuthHeader(String, String)Should create a correct basic auth header.
-
shouldGetDefaultHeaders
public void shouldGetDefaultHeaders()
Test ofHttpHeaderUtil.getDefaultHeaders(String)should get a correct default header by given site id.
-
shouldGetEnrichedHeaders
public void shouldGetEnrichedHeaders()
Test ofHttpHeaderUtil.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 fHttpHeaderUtil.addBatchHeaders(String)should return http headers which populated correctly data.
-
shouldEnrichHeaders
public void shouldEnrichHeaders()
Test ofHttpHeaderUtil.enrichHeaders(HttpHeaders, String)should return the enriched http headers with required data.
-
shouldThrownIllegalArgumentExceptionWhenUpdateTicketWithCompletedStatus
public void shouldThrownIllegalArgumentExceptionWhenUpdateTicketWithCompletedStatus() throws C4CServiceExceptionTest ofC4CTicketFacadeImpl.updateTicket(TicketData)should throw IllegalArgumentException when ticket is completed status.- Throws:
C4CServiceException
-
shouldUpdateTicketWithOpenStatus
public void shouldUpdateTicketWithOpenStatus() throws C4CServiceExceptionTest ofC4CTicketFacadeImpl.updateTicket(TicketData)should update the ticket when the status is open.- Throws:
com.fasterxml.jackson.core.JsonProcessingExceptionC4CServiceException
-
shouldReturnNullIfUpdateTicketWithOpenStatusResponseContainsError
public void shouldReturnNullIfUpdateTicketWithOpenStatusResponseContainsError() throws com.fasterxml.jackson.core.JsonProcessingException, C4CServiceExceptionTest ofC4CTicketFacadeImpl.updateTicket(TicketData)should return null if update ticket with open status bu the response contains errors.- Throws:
com.fasterxml.jackson.core.JsonProcessingExceptionC4CServiceException
-
-