Class DeclineIntegrationTest
- java.lang.Object
-
- de.hybris.platform.testframework.HybrisJUnit4Test
-
- de.hybris.platform.servicelayer.ServicelayerBaseTest
-
- de.hybris.platform.servicelayer.ServicelayerTest
-
- de.hybris.platform.yacceleratorordermanagement.integration.BaseAcceleratorIntegrationTest
-
- de.hybris.platform.yacceleratorordermanagement.integration.BaseAcceleratorSourcingIntegrationTest
-
- de.hybris.platform.yacceleratorordermanagement.integration.DeclineIntegrationTest
-
- All Implemented Interfaces:
JaloSessionHolder
@IntegrationTest public class DeclineIntegrationTest extends BaseAcceleratorSourcingIntegrationTest
This integration test creates a process and tests the order decline after the consignment is created. Please make sure that you have initialized and update junit tenant before running this test.
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.yacceleratorordermanagement.integration.BaseAcceleratorSourcingIntegrationTest
atpFormulas, automatedWorkflowActionTemplates, baseStores, CAMERA_CODE, CAMERA_QTY, cancellationUtil, CODE_BOSTON, CODE_MEMORY_CARD, CODE_MONTREAL, CODE_MONTREAL_EXTERNAL, CODE_PARIS, CODE_TORONTO, commentTypes, commerceStockService, components, CONSIGNMENT_ACTION_EVENT_NAME, csAgentGroups, DECLINE_ENTRIES, declineUtil, deliveryMode, domains, emailAddresses, LEFTOVER_QTY, LENS_CODE, LENS_QTY, MEMORY_CARD_CODE, MEMORY_CARD_QTY, modelService, order, ORDER_ACTION_EVENT_NAME, orderBusinessProcessService, orders, pointsOfService, products, productService, RE_SOURCE_CHOICE, REALLOCATE_CONSIGNMENT_CHOICE, restockConfigs, returnUtil, sourcingBanService, sourcingConfigs, sourcingUtil, stockLevels, stockService, timeOut, users, warehouses, warehouseStockService, workflowActionTemplates, workflowService, workflowTemplates, workflowUtil
-
Fields inherited from class de.hybris.platform.yacceleratorordermanagement.integration.BaseAcceleratorIntegrationTest
flexibleSearchService, 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 DeclineIntegrationTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()voidsetUp()voidshouldAutoDecline_PartiallyDeclineTwice()Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
partially decline same consignment twicevoidshouldAutoDecline_SuccessReSourcedTwice()Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Decline should SUCCESS without sufficient stock twicevoidshouldAutoDecline1Entry_MultiEntries_FailReSourced()Given an shipping order with 2 entries:
entry 1 : {quantity: 3, product: camera}
entry 2 : {quantity: 2, product: memoryCard}
Result:
Decline should FailvoidshouldAutoDecline1Entry_MultiEntries_SuccessReSourced()Given an shipping order with 2 entries:
entry 1 : {quantity: 3, product: camera}
entry 2 : {quantity: 2, product: memoryCard}
Result:
Decline should SUCCESS, and confirm ordervoidshouldAutoDecline2Entries_PartiallySuccessReSourced()Given an shipping order with 2 entries:
entry 1 : {quantity: 3, product: camera}
entry 2 : {quantity: 2, product: memoryCard}
Result:
Decline should SUCCESSvoidshouldAutoReallocate_MixManualAuto_ReSourcingFailed()Given an shipping order with 3 entries:
DeclineEntry 1 : auto
DeclineEntry 2 : manual
Result:
Decline should SUCCESSvoidshouldAutoReallocate_SingleEntry_FailReSourced__Damaged_ResetInventory()voidshouldAutoReallocate_SingleEntry_FailReSourced__OutOfStock_ResetInventory()Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Decline should SUCCESS with new location when to out of stock and reset inventoryvoidshouldAutoReallocate_SingleEntry_PartiallyFailReSourced()Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Decline should fail, and confirm the consignmentvoidshouldAutoReallocate_SingleEntry_PartiallyReSourcingSuccess()Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Decline should SUCCESS with new location when partially reallocatedvoidshouldAutoReallocate_SingleEntry_SuccessReSourced__ToBusy_BanLocation()Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Decline should SUCCESS with new location when to busy and ban first locationvoidshouldAutoReallocateAndReassignNewTaskAssignmentWorkFlowAfterPacking()Given an shipping order with 1 entry:
entry 1 : {quantity: 3, product: camera}
Perform a pack and perform complete auto-Reallocation on this consignment
Result:
1) A new Consignment is created, while the old consignment is cancelled
2) Task Assignment workflow for the older consingment is terminated and a new workflow is assigned to the new consignmentvoidshouldAutoReallocatePartiallyAndReassignNewTaskAssignmentWorkFlowAfterPacking()Given an shipping order with 1 entry:
entry 1 : {quantity: 3, product: camera}
Perform a pack and then perform partial auto-Reallocation on this consignment
Result:
1) A new Consignment is created, while the old consignment status is moved back toConsignmentStatus.READYfromConsignmentStatus.READY_FOR_SHIPPING
2) Task Assignment workflow for the older consingment is terminated and a new workflow is assigned to it.
2) Also a new Task Assignment workflow is assigned to the new consignment.voidshouldExcludeBanWarehouseDuringATPCalculation()Given a shipping order from USA with entry {quantity: 3, product: camera}
StockLevels : Montreal Warehouse: {quantity: 6, product: camera}
The order gets sourced from Montreal Warehouse and now the consignment is declined with reason TOOBUSY Result:
The Montreal warehouse is banned and the ATP value become to 0voidshouldManualReallocate_DamagedEntry_BanExternalWarehouse()Given an shipping order from USA with entry {quantity: 3, product: camera}
StockLevels : Montreal Warehouse(External) : {quantity: 6, product: camera}
Boston Warehouse(Internal) : {quantity: 3, product: camera}
The order gets sourced from Montreal Warehouse and now the consignment is declined with reason DAMAGED Result:
The order gets resourced from Boston and the Montreal warehouse is banned for 1 dayvoidshouldManualReallocate_SingleEntry()Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Decline should SUCCESS with new location when to busy and ban first locationvoidshouldManualReallocateAndReassignNewTaskAssignmentWorkFlowAfterPacking()Given an shipping order with 1 entry:
entry 1 : {quantity: 3, product: camera}
Perform a pack and then perform complete manual-Reallocation on this consignment
Result:
1) A new Consignment is created, while the old consignment is cancelled
2) Task Assignment workflow for the older consingment is terminated and a new workflow is assigned to the new consignmentvoidshouldManualReallocatePartiallyAndReassignNewTaskAssignmentWorkFlowAfterPacking()Given an shipping order with 1 entry:
entry 1 : {quantity: 3, product: camera}
Perform a pack and then perform partial manual-Reallocation on this consignment
Result:
1) A new Consignment is created, while the old consignment status is moved back toConsignmentStatus.READYfromConsignmentStatus.READY_FOR_SHIPPING
2) Task Assignment workflow for the older consingment is terminated and a new workflow is assigned to it.
2) Also a new Task Assignment workflow is assigned to the new consignment.voidshouldSuccessfullyAutoReallocateTwice()Given an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
The consignment is auto reallocated automatically with partial quantity 2 Then consignment is auto reallocated again with left over quantity 1 Result:
Decline should SUCCESS for both auto reallocation actions-
Methods inherited from class de.hybris.platform.yacceleratorordermanagement.integration.BaseAcceleratorSourcingIntegrationTest
buildAsnWorkflow, buildConsignmentWorkflow, cleanUpData, cleanUpModel, refreshConsignmentAndEntries, resetFactors, saveAll, setup
-
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() throws java.lang.Exception- Throws:
java.lang.Exception
-
cleanUp
public void cleanUp()
-
shouldAutoReallocate_SingleEntry_SuccessReSourced__ToBusy_BanLocation
public void shouldAutoReallocate_SingleEntry_SuccessReSourced__ToBusy_BanLocation() throws java.lang.InterruptedExceptionGiven an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Decline should SUCCESS with new location when to busy and ban first location- Throws:
java.lang.InterruptedException
-
shouldManualReallocate_SingleEntry
public void shouldManualReallocate_SingleEntry() throws java.lang.InterruptedExceptionGiven an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Decline should SUCCESS with new location when to busy and ban first location- Throws:
java.lang.InterruptedException
-
shouldManualReallocateAndReassignNewTaskAssignmentWorkFlowAfterPacking
public void shouldManualReallocateAndReassignNewTaskAssignmentWorkFlowAfterPacking() throws java.lang.InterruptedExceptionGiven an shipping order with 1 entry:
entry 1 : {quantity: 3, product: camera}
Perform a pack and then perform complete manual-Reallocation on this consignment
Result:
1) A new Consignment is created, while the old consignment is cancelled
2) Task Assignment workflow for the older consingment is terminated and a new workflow is assigned to the new consignment- Throws:
java.lang.InterruptedException
-
shouldManualReallocatePartiallyAndReassignNewTaskAssignmentWorkFlowAfterPacking
public void shouldManualReallocatePartiallyAndReassignNewTaskAssignmentWorkFlowAfterPacking() throws java.lang.InterruptedExceptionGiven an shipping order with 1 entry:
entry 1 : {quantity: 3, product: camera}
Perform a pack and then perform partial manual-Reallocation on this consignment
Result:
1) A new Consignment is created, while the old consignment status is moved back toConsignmentStatus.READYfromConsignmentStatus.READY_FOR_SHIPPING
2) Task Assignment workflow for the older consingment is terminated and a new workflow is assigned to it.
2) Also a new Task Assignment workflow is assigned to the new consignment.- Throws:
java.lang.InterruptedException
-
shouldAutoReallocateAndReassignNewTaskAssignmentWorkFlowAfterPacking
public void shouldAutoReallocateAndReassignNewTaskAssignmentWorkFlowAfterPacking() throws java.lang.InterruptedExceptionGiven an shipping order with 1 entry:
entry 1 : {quantity: 3, product: camera}
Perform a pack and perform complete auto-Reallocation on this consignment
Result:
1) A new Consignment is created, while the old consignment is cancelled
2) Task Assignment workflow for the older consingment is terminated and a new workflow is assigned to the new consignment- Throws:
java.lang.InterruptedException
-
shouldAutoReallocatePartiallyAndReassignNewTaskAssignmentWorkFlowAfterPacking
public void shouldAutoReallocatePartiallyAndReassignNewTaskAssignmentWorkFlowAfterPacking() throws java.lang.InterruptedExceptionGiven an shipping order with 1 entry:
entry 1 : {quantity: 3, product: camera}
Perform a pack and then perform partial auto-Reallocation on this consignment
Result:
1) A new Consignment is created, while the old consignment status is moved back toConsignmentStatus.READYfromConsignmentStatus.READY_FOR_SHIPPING
2) Task Assignment workflow for the older consingment is terminated and a new workflow is assigned to it.
2) Also a new Task Assignment workflow is assigned to the new consignment.- Throws:
java.lang.InterruptedException
-
shouldAutoReallocate_SingleEntry_PartiallyFailReSourced
public void shouldAutoReallocate_SingleEntry_PartiallyFailReSourced() throws java.lang.InterruptedExceptionGiven an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Decline should fail, and confirm the consignment- Throws:
java.lang.InterruptedException
-
shouldAutoReallocate_SingleEntry_FailReSourced__OutOfStock_ResetInventory
public void shouldAutoReallocate_SingleEntry_FailReSourced__OutOfStock_ResetInventory() throws java.lang.InterruptedExceptionGiven an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Decline should SUCCESS with new location when to out of stock and reset inventory- Throws:
java.lang.InterruptedException
-
shouldAutoReallocate_SingleEntry_PartiallyReSourcingSuccess
public void shouldAutoReallocate_SingleEntry_PartiallyReSourcingSuccess() throws java.lang.InterruptedExceptionGiven an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Decline should SUCCESS with new location when partially reallocated- Throws:
java.lang.InterruptedException
-
shouldAutoReallocate_MixManualAuto_ReSourcingFailed
public void shouldAutoReallocate_MixManualAuto_ReSourcingFailed() throws java.lang.InterruptedExceptionGiven an shipping order with 3 entries:
DeclineEntry 1 : auto
DeclineEntry 2 : manual
Result:
Decline should SUCCESS- Throws:
java.lang.InterruptedException
-
shouldAutoDecline_SuccessReSourcedTwice
public void shouldAutoDecline_SuccessReSourcedTwice() throws java.lang.InterruptedExceptionGiven an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
Decline should SUCCESS without sufficient stock twice- Throws:
java.lang.InterruptedException
-
shouldAutoDecline_PartiallyDeclineTwice
public void shouldAutoDecline_PartiallyDeclineTwice() throws java.lang.InterruptedExceptionGiven an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
Result:
partially decline same consignment twice- Throws:
java.lang.InterruptedException
-
shouldAutoDecline2Entries_PartiallySuccessReSourced
public void shouldAutoDecline2Entries_PartiallySuccessReSourced() throws java.lang.InterruptedExceptionGiven an shipping order with 2 entries:
entry 1 : {quantity: 3, product: camera}
entry 2 : {quantity: 2, product: memoryCard}
Result:
Decline should SUCCESS- Throws:
java.lang.InterruptedException
-
shouldAutoDecline1Entry_MultiEntries_SuccessReSourced
public void shouldAutoDecline1Entry_MultiEntries_SuccessReSourced() throws java.lang.InterruptedExceptionGiven an shipping order with 2 entries:
entry 1 : {quantity: 3, product: camera}
entry 2 : {quantity: 2, product: memoryCard}
Result:
Decline should SUCCESS, and confirm order- Throws:
java.lang.InterruptedException
-
shouldAutoDecline1Entry_MultiEntries_FailReSourced
public void shouldAutoDecline1Entry_MultiEntries_FailReSourced() throws java.lang.InterruptedExceptionGiven an shipping order with 2 entries:
entry 1 : {quantity: 3, product: camera}
entry 2 : {quantity: 2, product: memoryCard}
Result:
Decline should Fail- Throws:
java.lang.InterruptedException
-
shouldAutoReallocate_SingleEntry_FailReSourced__Damaged_ResetInventory
public void shouldAutoReallocate_SingleEntry_FailReSourced__Damaged_ResetInventory() throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
shouldManualReallocate_DamagedEntry_BanExternalWarehouse
public void shouldManualReallocate_DamagedEntry_BanExternalWarehouse() throws java.lang.InterruptedExceptionGiven an shipping order from USA with entry {quantity: 3, product: camera}
StockLevels : Montreal Warehouse(External) : {quantity: 6, product: camera}
Boston Warehouse(Internal) : {quantity: 3, product: camera}
The order gets sourced from Montreal Warehouse and now the consignment is declined with reason DAMAGED Result:
The order gets resourced from Boston and the Montreal warehouse is banned for 1 day- Throws:
java.lang.InterruptedException
-
shouldExcludeBanWarehouseDuringATPCalculation
public void shouldExcludeBanWarehouseDuringATPCalculation() throws java.lang.InterruptedExceptionGiven a shipping order from USA with entry {quantity: 3, product: camera}
StockLevels : Montreal Warehouse: {quantity: 6, product: camera}
The order gets sourced from Montreal Warehouse and now the consignment is declined with reason TOOBUSY Result:
The Montreal warehouse is banned and the ATP value become to 0- Throws:
java.lang.InterruptedException
-
shouldSuccessfullyAutoReallocateTwice
public void shouldSuccessfullyAutoReallocateTwice() throws java.lang.InterruptedExceptionGiven an shipping order with 1 entries:
entry 1 : {quantity: 3, product: camera}
The consignment is auto reallocated automatically with partial quantity 2 Then consignment is auto reallocated again with left over quantity 1 Result:
Decline should SUCCESS for both auto reallocation actions- Throws:
java.lang.InterruptedException
-
-