Class BaseWarehousingWebservicesIntegrationTest

    • Constructor Detail

      • BaseWarehousingWebservicesIntegrationTest

        public BaseWarehousingWebservicesIntegrationTest()
    • 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)
      • getWarehouseByDefault

        protected WarehouseWsDto getWarehouseByDefault​(java.lang.String code)
      • getConsignmentsForCodeByDefault

        protected ConsignmentWsDTO getConsignmentsForCodeByDefault​(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)
      • 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)
      • postStockLevelByDefault_WithReturnType_StockLevelWsDto

        protected StockLevelWsDto postStockLevelByDefault_WithReturnType_StockLevelWsDto​(StockLevelWsDto newStock)
      • getPackagingInfoByDefault

        protected PackagingInfoWsDTO getPackagingInfoByDefault​(java.lang.String code)
      • 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)
      • 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 call
        username - the username used for authentication
        password - the password used for authentication
        fields - contains pagination information
        currentPage - the current page of the request
        pageSize - total page size
        responseType - 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 call
        username - the username used for authentication
        password - the password used for authentication
        fields - contains pagination information
        requestBodyWsDTO - 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 updated
        T -
        Parameters:
        path - the url for the call
        username - the username used for authentication
        password - the password used for authentication
        fields - contains pagination information
        responseType - 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 call
        username - the username used for authentication
        password - the password used for authentication
        Returns:
        Response the 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 call
        username - the username used for authentication
        password - the password used for authentication
        requestBodyWsDTO - the request body
        Returns:
        Response the 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 call
        username - the username used for authentication
        password - 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 call
        username - the username used for authentication
        password - the password used for authentication
        fields - contains pagination information
        requestBodyWsDTO - the current dto which is to be updated
        responseType - 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 call
        username - the username used for authentication
        password - the password used for authentication
        fields - 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 first ErrorWsDTO content of the ErrorListWsDTO of the bad request
        Parameters:
        response - bad request response
        errorReason - error reason
        errorSubject - error subject
        ErrorSubjectType - 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:
        OrderModel that failed sourcing
      • 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 package
        height - the height of the package
        length - the length of the package
        grossWeight - the gross weight of the package
        insuredValue - the insured value of the package
        dimensionUnit - the dimension unit of the package
        weightUnit - the weight unit of the package
        Returns:
        the new PackagingInfoWsDTO
      • createReturnAndReadyToAcceptGoods

        protected RefundEntryModel createReturnAndReadyToAcceptGoods()
        Creates a return request in a ReturnStatus.WAIT.
        Returns:
        RefundEntryModel the created return request
      • setReturnCallbackService

        public void setReturnCallbackService​(ReturnCallbackService returnCallbackService)
      • setModelService

        public void setModelService​(ModelService modelService)
      • setBusinessProcessService

        public void setBusinessProcessService​(BusinessProcessService businessProcessService)