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.ServicelayerTest
Test cases for
C4CTicketFacadeImpl-
Field Summary
Fields inherited from class de.hybris.platform.servicelayer.ServicelayerTest
importServiceFields inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
jaloSession -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetup()Test setup.voidTest o fHttpHeaderUtil.addBatchHeaders(String)should return http headers which populated correctly data.voidTestC4CTicketFacadeImpl.createTicket(TicketData)Should create a ticket.voidTest ofHttpHeaderUtil.createBasicAuthHeader(String, String)Should create a correct basic auth header.voidTest ofHttpHeaderUtil.enrichHeaders(HttpHeaders, String)should return the enriched http headers with required data.voidTest ofC4CTicketFacadeImpl.getAssociatedToObjects()Should throw UnsupportedOperationException.voidTest ofHttpHeaderUtil.getDefaultHeaders(String)should get a correct default header by given site id.voidTest ofHttpHeaderUtil.getEnrichedHeaders()should return an enriched header.voidTest ofC4CTicketFacadeImpl.getTicket(String)should get a ticket DTO by given ticket id.voidTest ofC4CTicketFacadeImpl.getTicketCategories()Should throw UnsupportedOperationException.voidTest ofC4CTicketFacadeImpl.getTickets(PageableData)should return a SearchPageDataresult. voidTest ofC4CTicketFacadeImpl.getTickets(PageableData)should return an empty result list if throw IOException.voidTest ofC4CTicketFacadeImpl.updateTicket(TicketData)should return null if update ticket with open status bu the response contains errors.voidTest ofC4CTicketFacadeImpl.getTicket(String)Should return runtime exception when something goes wrongvoidTest ofC4CTicketFacadeImpl.getTicket(String)Should return runtime exception when something goes wrongvoidTest ofC4CTicketFacadeImpl.createTicket(TicketData)throws runtime exp.voidTest ofC4CTicketFacadeImpl.updateTicket(TicketData)should throw IllegalArgumentException when ticket is completed status.voidTest 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, isPrefetchModeNoneMethods inherited from class de.hybris.platform.servicelayer.ServicelayerBaseTest
autowireProperties, getBeanName, prepareApplicationContextAndSessionMethods inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
establishJaloSession, finish, getOrCreateCurrency, getOrCreateLanguage, init, intenseChecksActivated, takeJaloSession
-
Constructor Details
-
C4CTicketFacadeImplTest
public C4CTicketFacadeImplTest()
-
-
Method Details
-
setup
Test setup.- Throws:
C4CServiceException
-
shouldCreateATicket
TestC4CTicketFacadeImpl.createTicket(TicketData)Should create a ticket.- Throws:
IOExceptionC4CServiceException
-
shouldReturnRuntimeExceptionWhenThrowRestClientException
Test ofC4CTicketFacadeImpl.createTicket(TicketData)throws runtime exp. when RestClientException happens- Throws:
IOExceptionC4CServiceException
-
shouldGetTicket
Test ofC4CTicketFacadeImpl.getTicket(String)should get a ticket DTO by given ticket id.- Throws:
IOExceptionC4CServiceException
-
shouldReturnRuntimeExceptionWhenGetTicketThrowIOException
Test ofC4CTicketFacadeImpl.getTicket(String)Should return runtime exception when something goes wrong- Throws:
IOExceptionC4CServiceException
-
shouldReturnRuntimeExceptionWhenGetTicketThrowRestClientException
public void shouldReturnRuntimeExceptionWhenGetTicketThrowRestClientException() throws C4CServiceExceptionTest ofC4CTicketFacadeImpl.getTicket(String)Should return runtime exception when something goes wrong -
shouldGetTickets
Test ofC4CTicketFacadeImpl.getTickets(PageableData)should return a SearchPageDataresult. - Throws:
IOExceptionC4CServiceException
-
shouldReturnEmptySearchResultWhenGetTicketsThrowRestClientException
public void shouldReturnEmptySearchResultWhenGetTicketsThrowRestClientException() throws C4CServiceExceptionTest ofC4CTicketFacadeImpl.getTickets(PageableData)should return an empty result list if throw IOException.- Throws:
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
Test 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
-