Class BaseOrderManagementWebservicesIntegrationTest
- java.lang.Object
-
- de.hybris.platform.testframework.HybrisJUnit4Test
-
- de.hybris.platform.servicelayer.ServicelayerBaseTest
-
- de.hybris.platform.servicelayer.ServicelayerTest
-
- de.hybris.platform.ordermanagementwebservices.util.BaseOrderManagementWebservicesIntegrationTest
-
- All Implemented Interfaces:
JaloSessionHolder
- Direct Known Subclasses:
OrderControllerIntegrationTest,ReturnsControllerIntegrationTest,WorkflowControllerIntegrationTest
@IntegrationTest @ContextConfiguration(locations="classpath:/ordermanagementwebservices-spring-test.xml") public class BaseOrderManagementWebservicesIntegrationTest extends ServicelayerTest
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringADMIN_PASSWORDprotected static java.lang.StringADMIN_USERNAMEprotected static java.lang.StringCUSTOMER_SUPPORT_AGENT_PASSWORDprotected static java.lang.StringCUSTOMER_SUPPORT_AGENT_USERNAMEprotected static java.lang.StringDEFAULT_CLIENT_IDprotected static java.lang.StringDEFAULT_CLIENT_SECRETprotected static java.lang.StringDEFAULT_CURRENT_PAGEprotected static java.lang.StringDEFAULT_FIELDSprotected static java.lang.StringDEFAULT_PAGE_SIZE-
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 BaseOrderManagementWebservicesIntegrationTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidassertBadRequestWithContent(javax.ws.rs.core.Response response, java.lang.String errorReason, java.lang.String errorSubject, java.lang.String ErrorSubjectType)Validates the firstErrorWsDTOcontent of theErrorListWsDTOof the bad requestprotected OrderSearchPageWsDtogetAllOrderByDefault()protected <T> TgetDefaultSecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password, java.lang.String fields, java.lang.String currentPage, java.lang.String pageSize, java.lang.Class<T> responseType)Builds a secured GET rest callEnumerationServicegetEnumerationService()protected java.util.List<java.lang.String>getExtensionNames()Gets aListof all extensions loaded in the current setup.protected OrderWsDTOgetOrderByCode(java.lang.String code)protected CancelReasonListWsDTOgetOrderCancellationReasons()protected OrderEntrySearchPageWsDTOgetOrderEntriesForOrderCode(java.lang.String code)protected OrderEntryWsDTOgetOrderEntryForOrderCodeAndEntryNumber(java.lang.String code, java.lang.String entryNumber)protected FraudReportListWsDTOgetOrderFraudReports(java.lang.String code)protected <T> TgetOrdersByStatuses(java.lang.String orderStatuses, java.lang.Class<T> responseType)protected OrderStatusListWsDTOgetOrderStatusByDefault()protected RefundReasonListWsDTOgetRefundReasons()protected ReturnActionListWsDTOgetReturnActions()protected CancelReasonListWsDTOgetReturnCancellationReasons()protected ReturnEntrySearchPageWsDTOgetReturnEntriesForReturnCode(java.lang.String returnCode)protected ReturnRequestWsDTOgetReturnForReturnCode(java.lang.String returnCode)protected ReturnSearchPageWsDTOgetReturns()protected <T> TgetReturnsByStatus(java.lang.String statuses, java.lang.Class<T> responseType)protected ReturnStatusListWsDTOgetReturnStatuses()protected SetupImpexServicegetSetupImpexService()protected WorkflowActionListWsDtogetWorkflowActions()protected WsSecuredRequestBuildergetWsSecuredRequestBuilder()Retrieves a newWsSecuredRequestBuilderin order to build web requests.protected javax.ws.rs.core.ResponsepostApproveFraudulentOrder(java.lang.String code)protected javax.ws.rs.core.ResponsepostCancelOrder(OrderCancelRequestWsDTO orderCancelRequestWsDTO, java.lang.String code)protected javax.ws.rs.core.ResponsepostCancelReturnRequestByDefault(CancelReturnRequestWsDTO cancelReturnRequestWsDTO)protected javax.ws.rs.core.ResponsepostCreateOrder(OrderRequestWsDTO orderRequestWsDTO)protected javax.ws.rs.core.ResponsepostDecideWorkflowAction(java.lang.String workflowCode, java.lang.String workflowDecisionCode)protected javax.ws.rs.core.ResponsepostDecideWorkflowActions(WorkflowCodesListWsDto workflowCodesListWsDto, java.lang.String decisionCode)protected <T> javax.ws.rs.core.ResponsepostDefaultSecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password, java.lang.String fields, T requestBodyWsDTO)Builds a secured POST rest call.protected <T> TpostDefaultSecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password, java.lang.String fields, T requestBodyWsDTO, java.lang.Class<T> responseType)Builds a POST rest call with the return type. protected javax.ws.rs.core.ResponsepostEmptyBodySecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password)Builds a secured POST rest call with an empty bodyprotected javax.ws.rs.core.ResponsepostManualDeliveryCostCommit(java.lang.String code)protected javax.ws.rs.core.ResponsepostManualPaymentReauth(java.lang.String code)protected javax.ws.rs.core.ResponsepostManualPaymentVoid(java.lang.String code)protected javax.ws.rs.core.ResponsepostManualTaxCommit(java.lang.String code)protected javax.ws.rs.core.ResponsepostManualTaxRequote(java.lang.String code)protected javax.ws.rs.core.ResponsepostManualTaxVoid(java.lang.String code)protected javax.ws.rs.core.ResponsepostRejectFraudulentOrder(java.lang.String code)protected javax.ws.rs.core.ResponsepostRequestManualPaymentReversalForReturnRequest(java.lang.String returnCode)protected javax.ws.rs.core.ResponsepostRequestManualTaxReversalForReturnRequest(java.lang.String returnCode)protected <S,T>
TputDefaultSecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password, java.lang.String fields, S requestBodyWsDTO, java.lang.Class<T> responseType)Builds a PUT rest callprotected ReturnRequestWsDTOputUpdateReturnByReturnCode(java.lang.String code, ReturnRequestModificationWsDTO returnRequestModificationWsDTO)voidsetEnumerationService(EnumerationService enumerationService)voidsetSetupImpexService(SetupImpexService setupImpexService)-
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
-
-
-
-
Field Detail
-
DEFAULT_FIELDS
protected static final java.lang.String DEFAULT_FIELDS
- See Also:
- Constant Field Values
-
DEFAULT_CURRENT_PAGE
protected static final java.lang.String DEFAULT_CURRENT_PAGE
- See Also:
- Constant Field Values
-
DEFAULT_PAGE_SIZE
protected static final java.lang.String DEFAULT_PAGE_SIZE
- See Also:
- Constant Field Values
-
ADMIN_USERNAME
protected static final java.lang.String ADMIN_USERNAME
- See Also:
- Constant Field Values
-
ADMIN_PASSWORD
protected static final java.lang.String ADMIN_PASSWORD
- See Also:
- Constant Field Values
-
CUSTOMER_SUPPORT_AGENT_USERNAME
protected static final java.lang.String CUSTOMER_SUPPORT_AGENT_USERNAME
- See Also:
- Constant Field Values
-
CUSTOMER_SUPPORT_AGENT_PASSWORD
protected static final java.lang.String CUSTOMER_SUPPORT_AGENT_PASSWORD
- See Also:
- Constant Field Values
-
DEFAULT_CLIENT_ID
protected static final java.lang.String DEFAULT_CLIENT_ID
- See Also:
- Constant Field Values
-
DEFAULT_CLIENT_SECRET
protected static final java.lang.String DEFAULT_CLIENT_SECRET
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAllOrderByDefault
protected OrderSearchPageWsDto getAllOrderByDefault()
-
getOrderByCode
protected OrderWsDTO getOrderByCode(java.lang.String code)
-
getOrdersByStatuses
protected <T> T getOrdersByStatuses(java.lang.String orderStatuses, java.lang.Class<T> responseType)
-
getOrderEntriesForOrderCode
protected OrderEntrySearchPageWsDTO getOrderEntriesForOrderCode(java.lang.String code)
-
getOrderEntryForOrderCodeAndEntryNumber
protected OrderEntryWsDTO getOrderEntryForOrderCodeAndEntryNumber(java.lang.String code, java.lang.String entryNumber)
-
getOrderStatusByDefault
protected OrderStatusListWsDTO getOrderStatusByDefault()
-
getOrderFraudReports
protected FraudReportListWsDTO getOrderFraudReports(java.lang.String code)
-
getOrderCancellationReasons
protected CancelReasonListWsDTO getOrderCancellationReasons()
-
getReturnCancellationReasons
protected CancelReasonListWsDTO getReturnCancellationReasons()
-
getRefundReasons
protected RefundReasonListWsDTO getRefundReasons()
-
getReturnActions
protected ReturnActionListWsDTO getReturnActions()
-
getReturnStatuses
protected ReturnStatusListWsDTO getReturnStatuses()
-
getReturns
protected ReturnSearchPageWsDTO getReturns()
-
getReturnsByStatus
protected <T> T getReturnsByStatus(java.lang.String statuses, java.lang.Class<T> responseType)
-
getReturnForReturnCode
protected ReturnRequestWsDTO getReturnForReturnCode(java.lang.String returnCode)
-
getReturnEntriesForReturnCode
protected ReturnEntrySearchPageWsDTO getReturnEntriesForReturnCode(java.lang.String returnCode)
-
postRequestManualPaymentReversalForReturnRequest
protected javax.ws.rs.core.Response postRequestManualPaymentReversalForReturnRequest(java.lang.String returnCode)
-
postRequestManualTaxReversalForReturnRequest
protected javax.ws.rs.core.Response postRequestManualTaxReversalForReturnRequest(java.lang.String returnCode)
-
postCancelReturnRequestByDefault
protected javax.ws.rs.core.Response postCancelReturnRequestByDefault(CancelReturnRequestWsDTO cancelReturnRequestWsDTO)
-
postApproveFraudulentOrder
protected javax.ws.rs.core.Response postApproveFraudulentOrder(java.lang.String code)
-
postRejectFraudulentOrder
protected javax.ws.rs.core.Response postRejectFraudulentOrder(java.lang.String code)
-
postCancelOrder
protected javax.ws.rs.core.Response postCancelOrder(OrderCancelRequestWsDTO orderCancelRequestWsDTO, java.lang.String code)
-
postCreateOrder
protected javax.ws.rs.core.Response postCreateOrder(OrderRequestWsDTO orderRequestWsDTO)
-
putUpdateReturnByReturnCode
protected ReturnRequestWsDTO putUpdateReturnByReturnCode(java.lang.String code, ReturnRequestModificationWsDTO returnRequestModificationWsDTO)
-
postManualPaymentVoid
protected javax.ws.rs.core.Response postManualPaymentVoid(java.lang.String code)
-
postManualTaxVoid
protected javax.ws.rs.core.Response postManualTaxVoid(java.lang.String code)
-
postManualTaxCommit
protected javax.ws.rs.core.Response postManualTaxCommit(java.lang.String code)
-
postManualTaxRequote
protected javax.ws.rs.core.Response postManualTaxRequote(java.lang.String code)
-
postManualPaymentReauth
protected javax.ws.rs.core.Response postManualPaymentReauth(java.lang.String code)
-
postManualDeliveryCostCommit
protected javax.ws.rs.core.Response postManualDeliveryCostCommit(java.lang.String code)
-
getWorkflowActions
protected WorkflowActionListWsDto getWorkflowActions()
-
postDecideWorkflowAction
protected javax.ws.rs.core.Response postDecideWorkflowAction(java.lang.String workflowCode, java.lang.String workflowDecisionCode)
-
postDecideWorkflowActions
protected javax.ws.rs.core.Response postDecideWorkflowActions(WorkflowCodesListWsDto workflowCodesListWsDto, java.lang.String decisionCode)
-
getDefaultSecuredRestCall
protected <T> T getDefaultSecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password, java.lang.String fields, java.lang.String currentPage, java.lang.String pageSize, java.lang.Class<T> responseType)Builds a secured GET rest call- Parameters:
path- the url for the callusername- the username used for authenticationpassword- the password used for authenticationfields- contains pagination informationcurrentPage- the current page of the requestpageSize- total page sizeresponseType- the response entity type- Returns:
-
postDefaultSecuredRestCall
protected <T> T postDefaultSecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password, java.lang.String fields, T requestBodyWsDTO, java.lang.Class<T> responseType)Builds a POST rest call with the return type. - Type Parameters:
T- type of the body object- Parameters:
path- the url for the callusername- the username used for authenticationpassword- the password used for authenticationfields- contains pagination informationrequestBodyWsDTO- the dto object sent with the requestresponseType- type of class to return- Returns:
- the request class to return after the execution of the call
-
postDefaultSecuredRestCall
protected <T> javax.ws.rs.core.Response postDefaultSecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password, java.lang.String fields, T requestBodyWsDTO)Builds a secured POST rest call.- Type Parameters:
T- type of the body object- Parameters:
path- the url for the callusername- the username used for authenticationpassword- the password used for authenticationfields- contains pagination informationrequestBodyWsDTO- the dto object sent with the request- Returns:
- the result of the call
-
postEmptyBodySecuredRestCall
protected javax.ws.rs.core.Response postEmptyBodySecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password)Builds a secured POST rest call with an empty body- Parameters:
path- the url for the callusername- the username for authenticationpassword- the password for authentication- Returns:
- the result of the call
-
putDefaultSecuredRestCall
protected <S,T> T putDefaultSecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password, java.lang.String fields, S requestBodyWsDTO, java.lang.Class<T> responseType)Builds a PUT rest call- Type Parameters:
T-- Parameters:
path- the url for the callusername- the username used for authenticationpassword- the password used for authenticationfields- contains pagination informationrequestBodyWsDTO- the current dto which is to be updatedresponseType- type of class to return- Returns:
- the request class to return after the execution of the call
-
assertBadRequestWithContent
protected void assertBadRequestWithContent(javax.ws.rs.core.Response response, java.lang.String errorReason, java.lang.String errorSubject, java.lang.String ErrorSubjectType)Validates the firstErrorWsDTOcontent of theErrorListWsDTOof the bad request- Parameters:
response- bad request responseerrorReason- error reasonerrorSubject- error subjectErrorSubjectType- error subject type
-
getWsSecuredRequestBuilder
protected WsSecuredRequestBuilder getWsSecuredRequestBuilder()
Retrieves a newWsSecuredRequestBuilderin order to build web requests.- Returns:
- the
WsSecuredRequestBuilder
-
getExtensionNames
protected java.util.List<java.lang.String> getExtensionNames()
Gets aListof all extensions loaded in the current setup.- Returns:
- populated
Listof all loaded extensions
-
getSetupImpexService
protected SetupImpexService getSetupImpexService()
-
setSetupImpexService
public void setSetupImpexService(SetupImpexService setupImpexService)
-
getEnumerationService
public EnumerationService getEnumerationService()
-
setEnumerationService
public void setEnumerationService(EnumerationService enumerationService)
-
-