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 void
setup()
Test setup.void
shouldAddBatchHeaders()
Test o fC4CTicketFacadeImpl#addBatchHeaders(String)
should return http headers which populated correctly data.void
shouldCreateATicket()
TestC4CTicketFacadeImpl.createTicket(TicketData)
Should create a ticket.void
shouldCreateBasicAuthHeader()
Test ofC4CTicketFacadeImpl#createBasicAuthHeader(String, String)
Should create a correct basic auth header.void
shouldEnrichHeaders()
Test ofC4CTicketFacadeImpl#enrichHeaders(HttpHeaders, String)
should return the enriched http headers with required data.void
shouldGetAssociatedToObjectsThrowUnsupportedOperationException()
Test ofC4CTicketFacadeImpl.getAssociatedToObjects()
Should throw UnsupportedOperationException.void
shouldGetDefaultHeaders()
Test ofC4CTicketFacadeImpl#getDefaultHeaders(String)
should get a correct default header by given site id.void
shouldGetEnrichedHeaders()
Test ofC4CTicketFacadeImpl#getEnrichedHeaders()
should return an enriched header.void
shouldGetTicket()
Test ofC4CTicketFacadeImpl.getTicket(String)
should get a ticket DTO by given ticket id.void
shouldGetTicketCategoriesThrowUnsupportedOperationException()
Test ofC4CTicketFacadeImpl.getTicketCategories()
Should throw UnsupportedOperationException.void
shouldGetTickets()
Test ofC4CTicketFacadeImpl.getTickets(PageableData)
should return a SearchPageDataresult. void
shouldReturnCustomerSupportTicketExceptionWhenThrowIOException()
Test ofC4CTicketFacadeImpl.createTicket(TicketData)
Should return runtime exception when something happensvoid
shouldReturnEmptySearchResultWhenGetTicketsThrowIOException()
Test ofC4CTicketFacadeImpl.getTickets(PageableData)
should return an empty result list if throw IOException.void
shouldReturnEmptySearchResultWhenGetTicketsThrowRestClientException()
Test ofC4CTicketFacadeImpl.getTickets(PageableData)
should return an empty result list if throw RestClientException.void
shouldReturnNullIfUpdateTicketWithOpenStatusResponseContainsError()
Test ofC4CTicketFacadeImpl.updateTicket(TicketData)
should return null if update ticket with open status bu the response contains errors.void
shouldReturnRuntimeExceptionWhenGetTicketThrowIOException()
Test ofC4CTicketFacadeImpl.getTicket(String)
Should return runtime exception when something goes wrongvoid
shouldReturnRuntimeExceptionWhenGetTicketThrowRestClientException()
Test ofC4CTicketFacadeImpl.getTicket(String)
Should return runtime exception when something goes wrongvoid
shouldReturnRuntimeExceptionWhenThrowRestClientException()
Test ofC4CTicketFacadeImpl.createTicket(TicketData)
throws runtime exp.void
shouldThrownIllegalArgumentExceptionWhenUpdateTicketWithCompletedStatus()
Test ofC4CTicketFacadeImpl.updateTicket(TicketData)
should throw IllegalArgumentException when ticket is completed status.void
shouldUpdateTicketWithOpenStatus()
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.IOException
TestC4CTicketFacadeImpl.createTicket(TicketData)
Should create a ticket.- Throws:
java.io.IOException
-
shouldReturnRuntimeExceptionWhenThrowRestClientException
public void shouldReturnRuntimeExceptionWhenThrowRestClientException() throws java.io.IOException
Test ofC4CTicketFacadeImpl.createTicket(TicketData)
throws runtime exp. when RestClientException happens- Throws:
java.io.IOException
-
shouldReturnCustomerSupportTicketExceptionWhenThrowIOException
public void shouldReturnCustomerSupportTicketExceptionWhenThrowIOException() throws java.io.IOException
Test ofC4CTicketFacadeImpl.createTicket(TicketData)
Should return runtime exception when something happens- Throws:
java.io.IOException
-
shouldGetTicket
public void shouldGetTicket() throws java.io.IOException
Test ofC4CTicketFacadeImpl.getTicket(String)
should get a ticket DTO by given ticket id.- Throws:
java.io.IOException
-
shouldReturnRuntimeExceptionWhenGetTicketThrowIOException
public void shouldReturnRuntimeExceptionWhenGetTicketThrowIOException() throws java.io.IOException
Test ofC4CTicketFacadeImpl.getTicket(String)
Should return runtime exception when something goes wrong- Throws:
java.io.IOException
-
shouldReturnRuntimeExceptionWhenGetTicketThrowRestClientException
public void shouldReturnRuntimeExceptionWhenGetTicketThrowRestClientException() throws java.io.IOException
Test ofC4CTicketFacadeImpl.getTicket(String)
Should return runtime exception when something goes wrong- Throws:
java.io.IOException
java.lang.RuntimeException
-
shouldGetTickets
public void shouldGetTickets() throws java.io.IOException
Test ofC4CTicketFacadeImpl.getTickets(PageableData)
should return a SearchPageDataresult. - Throws:
java.io.IOException
-
shouldReturnEmptySearchResultWhenGetTicketsThrowIOException
public void shouldReturnEmptySearchResultWhenGetTicketsThrowIOException() throws java.io.IOException
Test ofC4CTicketFacadeImpl.getTickets(PageableData)
should return an empty result list if throw IOException.- Throws:
java.io.IOException
-
shouldReturnEmptySearchResultWhenGetTicketsThrowRestClientException
public void shouldReturnEmptySearchResultWhenGetTicketsThrowRestClientException() throws java.io.IOException
Test 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.JsonProcessingException
Test 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.JsonProcessingException
Test ofC4CTicketFacadeImpl.updateTicket(TicketData)
should return null if update ticket with open status bu the response contains errors.- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
-