Class OrderCancelPartialTest
- java.lang.Object
-
- de.hybris.platform.testframework.HybrisJUnit4Test
-
- de.hybris.platform.servicelayer.ServicelayerBaseTest
-
- de.hybris.platform.servicelayer.ServicelayerTest
-
- de.hybris.platform.servicelayer.ServicelayerTransactionalTest
-
- de.hybris.platform.ordercancel.AbstractOrderCancelTest
-
- de.hybris.platform.ordercancel.OrderCancelPartialTest
-
- All Implemented Interfaces:
JaloSessionHolder
- Direct Known Subclasses:
OrderManagementOrderCancelPartialTest
public class OrderCancelPartialTest extends AbstractOrderCancelTest
Tests partial cancel execution in different scenarios.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.ordercancel.AbstractOrderCancelTest
AbstractOrderCancelTest.AbstractMockOrderCancelStateManagementStrategy, AbstractOrderCancelTest.OrderCancelDaoMock, AbstractOrderCancelTest.RequestOriginStrategyHelper
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.ordercancel.AbstractOrderCancelTest
REQUEST_ORIGIN_STRATEGY_CSA, REQUEST_ORIGIN_STRATEGY_CUSTOMER, STATE_STRATEGY_HOLDING_AREA_QUEUE_WAITING, STATE_STRATEGY_IMPOSSIBLE, STATE_STRATEGY_PARTIALLY_SHIPPED, STATE_STRATEGY_SENT_TO_WAREHOUSE, STATE_STRATEGY_SHIPPING
-
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 OrderCancelPartialTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
customSetUp()
void
testAllCancelableOrderEntriesNoConsignments()
This verifies that methodOrderCancelService.getAllCancelableEntries(OrderModel, PrincipalModel)
returns information that every entry can be completely canceled when order has no consignmentsvoid
testAllCancelableOrderEntriesWithConsignments()
This verifies that methodOrderCancelService.getAllCancelableEntries(OrderModel, PrincipalModel)
returns information that every entry can be completely canceled when order is splitted into consignments and every consignment has a status READY and no item has been shippedvoid
testPartialCancelationBeforeWarehouse()
Given an Order that contains a set of order entries containing items (products) and Partial Order Cancellation is possible and the Order hasn't been sent to the warehouse yet (Order queue waiting time has not expired) then after Order Cancel Partial Request:void
testPartialEntryCancelationBeforeWarehouse()
Given an Order that contains a set of order entries containing items (products) and Partial Order Entry Cancellation is possible and the Order hasn't been sent to the warehouse yet (Order queue waiting time has not expired) then after Order Cancel Partial Request:void
testSomeCancelableOrderEntriesWithConsignments()
This verifies that methodOrderCancelService.getAllCancelableEntries(OrderModel, PrincipalModel)
returns information that: order entries that belongs to consignments with status SHIPPED cannot be cancelled order entries that belongs to consignments with status READY and no items are shipped can be cancelled completely order entries that belongs to consignments with status READY and some items are shipped can be cancelled only partiallyvoid
testWarehouseResponsePartialCancelDenied()
Given an Order that contains a set of order entries containing items (products) and Order Cancel Entry with "pending" state then after Cancel Denied Warehouse responsevoid
testWarehouseResponsePartialCancelOK()
Given an Order that contains a set of order entries containing items (products) and Order Cancel Entry with "pending" state then after Cancel Successful Warehouse responsevoid
testWarehouseResponsePartialCancelPartialOK()
Given an Order that contains a set of order entries containing items (products) and Order Cancel Entry with "pending" state then after Cancel Partially Successful Warehouse responsevoid
testWarehouseResponsePartialEntryCancelDenied()
Given an Order that contains a set of order entries containing items (products) and Order Cancel Entry with "pending" state then after Cancel Denied Warehouse responsevoid
testWarehouseResponsePartialEntryCancelOK()
Given an Order that contains a set of order entries containing items (products) and Order Cancel Entry with "pending" state then after Cancel Successful Warehouse response-
Methods inherited from class de.hybris.platform.ordercancel.AbstractOrderCancelTest
createCancelRecord, createCancelRecordEntry, createSnaphot, getConfig, getConfiguration, getCurrentPrincipal, getModelService, getOrCreateOrderCancelConfig, getOrder, getOrderCancelService, getProduct3, injectAdaptersDependencies, injectStateMappingStrategy, placeTestOrder, setConfig, setConfiguration, setCurrentPrincipal, setModelService, setOrder, setOrderCancelService, setProduct3, setUp, tearDown
-
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
-
customSetUp
public void customSetUp() throws InvalidCartException
- Throws:
InvalidCartException
-
testPartialCancelationBeforeWarehouse
public void testPartialCancelationBeforeWarehouse() throws java.lang.Exception
Given an Order that contains a set of order entries containing items (products) and Partial Order Cancellation is possible and the Order hasn't been sent to the warehouse yet (Order queue waiting time has not expired) then after Order Cancel Partial Request:Order Cancel Entry should be created and set to "complete" state Canceled order entries should be removed. Order should be recalculated according to new set of Order Entries. State of the Order is unchanged.
- Throws:
java.lang.Exception
-
testPartialEntryCancelationBeforeWarehouse
public void testPartialEntryCancelationBeforeWarehouse() throws java.lang.Exception
Given an Order that contains a set of order entries containing items (products) and Partial Order Entry Cancellation is possible and the Order hasn't been sent to the warehouse yet (Order queue waiting time has not expired) then after Order Cancel Partial Request:Order Cancel Entry should be created and set to "complete" state Quantity of order entries subject to cancelling should be reduced. Order should be recalculated according to new set of Order Entries. State of the Order is unchanged.
- Throws:
java.lang.Exception
-
testWarehouseResponsePartialCancelOK
public void testWarehouseResponsePartialCancelOK() throws java.lang.Exception
Given an Order that contains a set of order entries containing items (products) and Order Cancel Entry with "pending" state then after Cancel Successful Warehouse responseOrder Cancel Entry should be updated with "completed" status. Canceled order entries should be removed. Order should be recalculated according to new set of Order Entries. State of the Order is restored to original value (before cancel request).
- Throws:
java.lang.Exception
-
testWarehouseResponsePartialEntryCancelOK
public void testWarehouseResponsePartialEntryCancelOK() throws java.lang.Exception
Given an Order that contains a set of order entries containing items (products) and Order Cancel Entry with "pending" state then after Cancel Successful Warehouse responseOrder Cancel Entry should be updated with "completed" status. Order entries subject to cancel should have their quantity reduced. Order should be recalculated according to new set of Order Entries. State of the Order is restored to original value (before cancel request).
- Throws:
java.lang.Exception
-
testWarehouseResponsePartialCancelDenied
public void testWarehouseResponsePartialCancelDenied() throws java.lang.Exception
Given an Order that contains a set of order entries containing items (products) and Order Cancel Entry with "pending" state then after Cancel Denied Warehouse responseOrder Cancel Entry should be updated with "completed" status and reason code. State of the Order is restored to original value (before cancel request).
- Throws:
java.lang.Exception
-
testWarehouseResponsePartialEntryCancelDenied
public void testWarehouseResponsePartialEntryCancelDenied() throws java.lang.Exception
Given an Order that contains a set of order entries containing items (products) and Order Cancel Entry with "pending" state then after Cancel Denied Warehouse responseOrder Cancel Entry should be updated with "completed" status and reason code. State of the Order is restored to original value (before cancel request).
- Throws:
java.lang.Exception
-
testWarehouseResponsePartialCancelPartialOK
public void testWarehouseResponsePartialCancelPartialOK() throws java.lang.Exception
Given an Order that contains a set of order entries containing items (products) and Order Cancel Entry with "pending" state then after Cancel Partially Successful Warehouse responseOrder Cancel Entry should be updated with "completed" status and reason code, and list of product entries that were cancelled. Canceled order entries should be removed. Order entries subject to partial cancel should have their quantity reduced. Order should be recalculated according to new set of Order Entries. State of the Order is restored to original value (before cancel request).
- Throws:
java.lang.Exception
-
testAllCancelableOrderEntriesNoConsignments
public void testAllCancelableOrderEntriesNoConsignments()
This verifies that methodOrderCancelService.getAllCancelableEntries(OrderModel, PrincipalModel)
returns information that every entry can be completely canceled when order has no consignments
-
testAllCancelableOrderEntriesWithConsignments
public void testAllCancelableOrderEntriesWithConsignments()
This verifies that methodOrderCancelService.getAllCancelableEntries(OrderModel, PrincipalModel)
returns information that every entry can be completely canceled when order is splitted into consignments and every consignment has a status READY and no item has been shipped
-
testSomeCancelableOrderEntriesWithConsignments
public void testSomeCancelableOrderEntriesWithConsignments()
This verifies that methodOrderCancelService.getAllCancelableEntries(OrderModel, PrincipalModel)
returns information that:- order entries that belongs to consignments with status SHIPPED cannot be cancelled
- order entries that belongs to consignments with status READY and no items are shipped can be cancelled completely
- order entries that belongs to consignments with status READY and some items are shipped can be cancelled only partially
-
-