Class BaseWarehousingWebservicesIntegrationTest
- java.lang.Object
-
- de.hybris.platform.testframework.HybrisJUnit4Test
-
- de.hybris.platform.servicelayer.ServicelayerBaseTest
-
- de.hybris.platform.servicelayer.ServicelayerTest
-
- de.hybris.platform.warehousingwebservices.warehousingwebservices.util.BaseWebservicesIntegrationTest
-
- de.hybris.platform.warehousingwebservices.warehousingwebservices.util.BaseWarehousingWebservicesIntegrationTest
-
- All Implemented Interfaces:
JaloSessionHolder
- Direct Known Subclasses:
AsnsControllerIntegrationTest,BaseStoresControllerIntegrationTest,ConsignmentsControllerIntegrationTest,OrdersControllerIntegrationTest,PointOfServicesControllerIntegrationTest,ReturnsControllerIntegrationTest,StockLevelsControllersIntegrationTest,WarehousesControllerIntegrationTest
@IntegrationTest public class BaseWarehousingWebservicesIntegrationTest extends BaseWebservicesIntegrationTest
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.warehousingwebservices.warehousingwebservices.util.BaseWebservicesIntegrationTest
springCustomContextLoader
-
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 BaseWarehousingWebservicesIntegrationTest()
-
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 voidcleanUpData()protected voidcleanUpModel(java.lang.String modelName)protected RefundEntryModelcreateApprovedReturnRequest(OrderModel order)Creates a default return request and approves it.protected ConsignmentReallocationWsDTOcreateConsignmentReallocationWsDTO()Creates aConsignmentReallocationWsDTOprotected OrderModelcreateFailedSourcedOrder()Creates an order that fails sourcing.protected PackagingInfoWsDTOcreatePackagingInfo(java.lang.String width, java.lang.String height, java.lang.String length, java.lang.String grossWeight, java.lang.String insuredValue, java.lang.String dimensionUnit, java.lang.String weightUnit)Creates a new packaging information for a consignment with the given attributes.protected RefundEntryModelcreateReturnAndReadyToAcceptGoods()Creates a return request in aReturnStatus.WAIT.protected OrderModelcreateShippedConsignmentAndOrder()Creates a default order and consignment.protected AddressWsDTOcreateUsAddress()Creates a US address.protected javax.ws.rs.core.ResponsedeleteDefaultSecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password, java.lang.String fields)Builds a DELETE rest callprotected javax.ws.rs.core.ResponsedeleteWarehousesFromPointOfService(java.lang.String name, java.lang.String warehouseCode)protected ConsignmentSearchPageWsDtogetAllConsignmentsByDefault()protected WarehouseSearchPageWsDtogetAllWarehousesByDefault()BusinessProcessServicegetBusinessProcessService()protected ConsignmentEntrySearchPageWsDtogetConsignmentEntriesByDefault(java.lang.String code)protected ConsignmentWsDTOgetConsignmentsForCodeByDefault(java.lang.String code)protected ConsignmentStatusListWsDTOgetConsignmentStatusByDefault()protected DeclineReasonListWsDTOgetDeclineReasonsByDefault()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 callprotected javax.ws.rs.core.ResponsegetEmptySecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password)this method is to build the rest call with null body for get with the return type ResponseEventServicegetEventService()ModelServicegetModelService()protected PackagingInfoWsDTOgetPackagingInfoByDefault(java.lang.String code)protected PointOfServiceWsDTOgetPointOfServiceByDefault(java.lang.String name)ReturnCallbackServicegetReturnCallbackService()protected WarehouseSearchPageWsDtogetSourcingLocationsByDefault(java.lang.String code)protected StockLevelAdjustmentReasonsWsDTOgetStockLevelAdjustmentReasons()protected StockLevelSearchPageWsDtogetStockLevelsForWarehouseCodeByDefault(java.lang.String code)protected WarehouseWsDtogetWarehouseByDefault(java.lang.String code)protected WarehouseSearchPageWsDtogetWarehouseForPointOfServiceByDefault(java.lang.String pointOfService)protected javax.ws.rs.core.ResponsemanuallyReleasePaymentCaptureRestCall(java.lang.String consignmentCode)protected javax.ws.rs.core.ResponsemanuallyReleaseTaxCommitRestCall(java.lang.String consignmentCode)protected javax.ws.rs.core.ResponsepostAcceptGoodsByDefault(java.lang.String code)protected javax.ws.rs.core.ResponsepostAsnByDefault(AsnWsDTO newAsn)protected <T> javax.ws.rs.core.ResponsepostBodySecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password, T requestBodyWsDTO)this method is to build the rest call with body for post with the return type Responseprotected javax.ws.rs.core.ResponsepostConfirmAsnReceiptByDefault(java.lang.String asnInternalId)protected <S,T>
TpostDefaultSecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password, java.lang.String fields, S requestBodyWsDTO, java.lang.Class<T> responseType)this method is to build the rest call post with the return typeprotected <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 javax.ws.rs.core.ResponsepostEmptyBodySecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password)this method is to build the rest call with null body for post with the return type Responseprotected javax.ws.rs.core.ResponsepostPackConsignmentDefault(java.lang.String consignmentCode)protected javax.ws.rs.core.ResponsepostPackConsignmentWithPrintSlip(java.lang.String consignmentCode, java.lang.String username, java.lang.String password, java.lang.String printSlip)protected javax.ws.rs.core.ResponsepostPickConsignmentDefault(java.lang.String consignmentCode)protected javax.ws.rs.core.ResponsepostPickConsignmentWithPrintSlip(java.lang.String consignmentCode, java.lang.String username, java.lang.String password, java.lang.String printSlip)protected javax.ws.rs.core.ResponsepostPutOrderOnHold(java.lang.String orderCode)protected javax.ws.rs.core.ResponsepostResourceOrder(java.lang.String orderCode)protected StockLevelAdjustmentsWsDTOpostStockLevelAdjustmentByDefault(java.lang.String productCode, java.lang.String warehouseCode, StockLevelAdjustmentsWsDTO stockLevelAdjustmentsWsDTO)protected javax.ws.rs.core.ResponsepostStockLevelAdjustmentByDefault_Reponse(java.lang.String productCode, java.lang.String warehouseCode, StockLevelAdjustmentsWsDTO stockLevelAdjustmentsWsDTO)protected javax.ws.rs.core.ResponsepostStockLevelByDefault(StockLevelWsDto newStock)protected StockLevelWsDtopostStockLevelByDefault_WithReturnType_StockLevelWsDto(StockLevelWsDto newStock)protected PaymentTransactionEntryWsDTOpostTakePaymentRestCall(java.lang.String consignmentCode)protected PointOfServiceWsDTOpostUpdatePointOfServiceWarehouses(java.lang.String name, WarehouseCodesWsDto warehouseCodesWsDTO)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 PointOfServiceWsDTOputUpdatePointOfServiceAddress(java.lang.String pointOfService, AddressWsDTO addressWsDTO)protected voidsaveAll()Saves any unsaved models.voidsetBusinessProcessService(BusinessProcessService businessProcessService)voidsetModelService(ModelService modelService)voidsetReturnCallbackService(ReturnCallbackService returnCallbackService)voidsetup()protected voidstartConsignmentProcess(ConsignmentModel consignment)Stars a business process for the givenConsignmentModelprotected ConsignmentWsDTOupdatePackagingInfoByDefault(java.lang.String code, PackagingInfoWsDTO packagingInfoWsDTO)protected voidwaitForReturnProcessComplete(java.util.Collection<ReturnProcessModel> returnProcessModels)Waits for the process to complete before the time out.-
Methods inherited from class de.hybris.platform.warehousingwebservices.warehousingwebservices.util.BaseWebservicesIntegrationTest
getEnumerationService, getWsSecuredRequestBuilder, setEnumerationService
-
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
-
STOCKLEVELS
protected static final java.lang.String STOCKLEVELS
- See Also:
- Constant Field Values
-
ASNS
protected static final java.lang.String ASNS
- See Also:
- Constant Field Values
-
WAREHOUSE_AGENT_USERNAME
protected static final java.lang.String WAREHOUSE_AGENT_USERNAME
- See Also:
- Constant Field Values
-
WAREHOUSE_AGENT_PASSWORD
protected static final java.lang.String WAREHOUSE_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
-
sourcingService
protected SourcingService sourcingService
-
modelService
protected ModelService modelService
-
orders
protected Orders orders
-
baseStores
protected BaseStores baseStores
-
warehouses
protected Warehouses warehouses
-
addresses
protected Addresses addresses
-
stockLevels
protected StockLevels stockLevels
-
pointsOfService
protected PointsOfService pointsOfService
-
products
protected Products products
-
allocationService
protected AllocationService allocationService
-
warehousingReturnService
protected WarehousingReturnService warehousingReturnService
-
businessProcessService
protected BusinessProcessService businessProcessService
-
users
protected Users users
-
deliveryModes
protected DeliveryModes deliveryModes
-
eventService
protected EventService eventService
-
returnCallbackService
protected ReturnCallbackService returnCallbackService
-
baseSites
protected BaseSites baseSites
-
components
protected Components components
-
commentTypes
protected CommentTypes commentTypes
-
flexibleSearchService
protected FlexibleSearchService flexibleSearchService
-
-
Method Detail
-
setup
public void setup()
-
saveAll
protected void saveAll()
Saves any unsaved models.
-
cleanUpData
protected void cleanUpData()
-
cleanUpModel
protected void cleanUpModel(java.lang.String modelName)
-
getStockLevelsForWarehouseCodeByDefault
protected StockLevelSearchPageWsDto getStockLevelsForWarehouseCodeByDefault(java.lang.String code)
-
getAllWarehousesByDefault
protected WarehouseSearchPageWsDto getAllWarehousesByDefault()
-
getAllConsignmentsByDefault
protected ConsignmentSearchPageWsDto getAllConsignmentsByDefault()
-
getWarehouseByDefault
protected WarehouseWsDto getWarehouseByDefault(java.lang.String code)
-
getConsignmentsForCodeByDefault
protected ConsignmentWsDTO getConsignmentsForCodeByDefault(java.lang.String code)
-
getConsignmentStatusByDefault
protected ConsignmentStatusListWsDTO getConsignmentStatusByDefault()
-
getDeclineReasonsByDefault
protected DeclineReasonListWsDTO getDeclineReasonsByDefault()
-
getConsignmentEntriesByDefault
protected ConsignmentEntrySearchPageWsDto getConsignmentEntriesByDefault(java.lang.String code)
-
getSourcingLocationsByDefault
protected WarehouseSearchPageWsDto getSourcingLocationsByDefault(java.lang.String code)
-
getPointOfServiceByDefault
protected PointOfServiceWsDTO getPointOfServiceByDefault(java.lang.String name)
-
getWarehouseForPointOfServiceByDefault
protected WarehouseSearchPageWsDto getWarehouseForPointOfServiceByDefault(java.lang.String pointOfService)
-
postUpdatePointOfServiceWarehouses
protected PointOfServiceWsDTO postUpdatePointOfServiceWarehouses(java.lang.String name, WarehouseCodesWsDto warehouseCodesWsDTO)
-
deleteWarehousesFromPointOfService
protected javax.ws.rs.core.Response deleteWarehousesFromPointOfService(java.lang.String name, java.lang.String warehouseCode)
-
putUpdatePointOfServiceAddress
protected PointOfServiceWsDTO putUpdatePointOfServiceAddress(java.lang.String pointOfService, AddressWsDTO addressWsDTO)
-
postAcceptGoodsByDefault
protected javax.ws.rs.core.Response postAcceptGoodsByDefault(java.lang.String code)
-
postStockLevelByDefault
protected javax.ws.rs.core.Response postStockLevelByDefault(StockLevelWsDto newStock)
-
postAsnByDefault
protected javax.ws.rs.core.Response postAsnByDefault(AsnWsDTO newAsn)
-
postConfirmAsnReceiptByDefault
protected javax.ws.rs.core.Response postConfirmAsnReceiptByDefault(java.lang.String asnInternalId)
-
postStockLevelAdjustmentByDefault_Reponse
protected javax.ws.rs.core.Response postStockLevelAdjustmentByDefault_Reponse(java.lang.String productCode, java.lang.String warehouseCode, StockLevelAdjustmentsWsDTO stockLevelAdjustmentsWsDTO)
-
postStockLevelAdjustmentByDefault
protected StockLevelAdjustmentsWsDTO postStockLevelAdjustmentByDefault(java.lang.String productCode, java.lang.String warehouseCode, StockLevelAdjustmentsWsDTO stockLevelAdjustmentsWsDTO)
-
postStockLevelByDefault_WithReturnType_StockLevelWsDto
protected StockLevelWsDto postStockLevelByDefault_WithReturnType_StockLevelWsDto(StockLevelWsDto newStock)
-
getStockLevelAdjustmentReasons
protected StockLevelAdjustmentReasonsWsDTO getStockLevelAdjustmentReasons()
-
getPackagingInfoByDefault
protected PackagingInfoWsDTO getPackagingInfoByDefault(java.lang.String code)
-
updatePackagingInfoByDefault
protected ConsignmentWsDTO updatePackagingInfoByDefault(java.lang.String code, PackagingInfoWsDTO packagingInfoWsDTO)
-
postResourceOrder
protected javax.ws.rs.core.Response postResourceOrder(java.lang.String orderCode)
-
postPutOrderOnHold
protected javax.ws.rs.core.Response postPutOrderOnHold(java.lang.String orderCode)
-
postPackConsignmentDefault
protected javax.ws.rs.core.Response postPackConsignmentDefault(java.lang.String consignmentCode)
-
postPackConsignmentWithPrintSlip
protected javax.ws.rs.core.Response postPackConsignmentWithPrintSlip(java.lang.String consignmentCode, java.lang.String username, java.lang.String password, java.lang.String printSlip)
-
postPickConsignmentDefault
protected javax.ws.rs.core.Response postPickConsignmentDefault(java.lang.String consignmentCode)
-
postPickConsignmentWithPrintSlip
protected javax.ws.rs.core.Response postPickConsignmentWithPrintSlip(java.lang.String consignmentCode, java.lang.String username, java.lang.String password, java.lang.String printSlip)
-
postTakePaymentRestCall
protected PaymentTransactionEntryWsDTO postTakePaymentRestCall(java.lang.String consignmentCode)
-
manuallyReleasePaymentCaptureRestCall
protected javax.ws.rs.core.Response manuallyReleasePaymentCaptureRestCall(java.lang.String consignmentCode)
-
manuallyReleaseTaxCommitRestCall
protected javax.ws.rs.core.Response manuallyReleaseTaxCommitRestCall(java.lang.String consignmentCode)
-
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:
- the result 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
-
postDefaultSecuredRestCall
protected <S,T> T postDefaultSecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password, java.lang.String fields, S requestBodyWsDTO, java.lang.Class<T> responseType)this method is to build the rest call post with the return type- Type Parameters:
T- the current dto which is to be updatedT-- Parameters:
path- the url for the callusername- the username used for authenticationpassword- the password used for authenticationfields- contains pagination informationresponseType- type of class to return- Returns:
- the request class to return after the execution of the call
-
postEmptyBodySecuredRestCall
protected javax.ws.rs.core.Response postEmptyBodySecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password)this method is to build the rest call with null body for post with the return type Response- Parameters:
path- the url for the callusername- the username used for authenticationpassword- the password used for authentication- Returns:
Responsethe result of the call
-
postBodySecuredRestCall
protected <T> javax.ws.rs.core.Response postBodySecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password, T requestBodyWsDTO)this method is to build the rest call with body for post with the return type Response- Parameters:
path- the url of the callusername- the username used for authenticationpassword- the password used for authenticationrequestBodyWsDTO- the request body- Returns:
Responsethe result of the call
-
getEmptySecuredRestCall
protected javax.ws.rs.core.Response getEmptySecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password)this method is to build the rest call with null body for get with the return type Response- Parameters:
path- the url for the callusername- the username used for authenticationpassword- the password used for authentication- Returns:
Response
-
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
-
deleteDefaultSecuredRestCall
protected javax.ws.rs.core.Response deleteDefaultSecuredRestCall(java.lang.String path, java.lang.String username, java.lang.String password, java.lang.String fields)Builds a DELETE rest call- Parameters:
path- the url for the callusername- the username used for authenticationpassword- the password used for authenticationfields- contains pagination information- 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
-
createShippedConsignmentAndOrder
protected OrderModel createShippedConsignmentAndOrder()
Creates a default order and consignment.- Returns:
- OrderModel the newly created order
-
createFailedSourcedOrder
protected OrderModel createFailedSourcedOrder()
Creates an order that fails sourcing.- Returns:
OrderModelthat failed sourcing
-
startConsignmentProcess
protected void startConsignmentProcess(ConsignmentModel consignment)
Stars a business process for the givenConsignmentModel- Parameters:
consignment- theConsignmentModelfor which a process will be started
-
createApprovedReturnRequest
protected RefundEntryModel createApprovedReturnRequest(OrderModel order)
Creates a default return request and approves it.- Parameters:
order- the order with which to create the return request- Returns:
- RefundEntryModel the created refund entry
-
waitForReturnProcessComplete
protected void waitForReturnProcessComplete(java.util.Collection<ReturnProcessModel> returnProcessModels)
Waits for the process to complete before the time out.- Parameters:
returnProcessModels- a collection of return processes
-
createUsAddress
protected AddressWsDTO createUsAddress()
Creates a US address.- Returns:
- the newly created address
-
createPackagingInfo
protected PackagingInfoWsDTO createPackagingInfo(java.lang.String width, java.lang.String height, java.lang.String length, java.lang.String grossWeight, java.lang.String insuredValue, java.lang.String dimensionUnit, java.lang.String weightUnit)
Creates a new packaging information for a consignment with the given attributes.- Parameters:
width- the width of the packageheight- the height of the packagelength- the length of the packagegrossWeight- the gross weight of the packageinsuredValue- the insured value of the packagedimensionUnit- the dimension unit of the packageweightUnit- the weight unit of the package- Returns:
- the new
PackagingInfoWsDTO
-
createConsignmentReallocationWsDTO
protected ConsignmentReallocationWsDTO createConsignmentReallocationWsDTO()
Creates aConsignmentReallocationWsDTO- Returns:
- the newly created
ConsignmentReallocationWsDTO
-
createReturnAndReadyToAcceptGoods
protected RefundEntryModel createReturnAndReadyToAcceptGoods()
Creates a return request in aReturnStatus.WAIT.- Returns:
- RefundEntryModel the created return request
-
getEventService
public EventService getEventService()
-
getReturnCallbackService
public ReturnCallbackService getReturnCallbackService()
-
setReturnCallbackService
public void setReturnCallbackService(ReturnCallbackService returnCallbackService)
-
getModelService
public ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getBusinessProcessService
public BusinessProcessService getBusinessProcessService()
-
setBusinessProcessService
public void setBusinessProcessService(BusinessProcessService businessProcessService)
-
-