Class FraudCheckIntegrationTest

  • All Implemented Interfaces:
    de.hybris.platform.testframework.JaloSessionHolder

    @IntegrationTest
    public class FraudCheckIntegrationTest
    extends de.hybris.platform.servicelayer.ServicelayerTest
    Integration test which test flow of order-process process when fraudCheck node return FRAUD
    • Field Detail

      • PARAM_NAME_MIN_PERIOD_WAITING_FOR_CLEANUP_IN_SECONDS

        protected static final java.lang.String PARAM_NAME_MIN_PERIOD_WAITING_FOR_CLEANUP_IN_SECONDS
        See Also:
        Constant Field Values
      • PARAM_NAME_FRAUD_SCORE_LIMIT

        protected static final java.lang.String PARAM_NAME_FRAUD_SCORE_LIMIT
        See Also:
        Constant Field Values
      • PARAM_NAME_FRAUD_SCORE_TOLERANCE

        protected static final java.lang.String PARAM_NAME_FRAUD_SCORE_TOLERANCE
        See Also:
        Constant Field Values
    • Constructor Detail

      • FraudCheckIntegrationTest

        public FraudCheckIntegrationTest()
    • Method Detail

      • beforeClass

        public static void beforeClass()
        Load bean definition from b2ctelcofulfillmentprocess-spring-test-fraudcheck.xml
      • afterClass

        public static void afterClass()
        revert changes made beforeClass()
      • registerEvents

        protected void registerEvents()
      • unregisterEvents

        protected void unregisterEvents()
      • revertOldConfigParameterValues

        protected void revertOldConfigParameterValues()
      • setFraudScoreLimit

        protected void setFraudScoreLimit​(int newScoreLimit)
      • setFraudScoreTolerance

        protected void setFraudScoreTolerance​(int newScoreTolerance)
      • setMinPeriodWaitingForCleanUpConfigParam

        protected void setMinPeriodWaitingForCleanUpConfigParam​(int numberOfSeconds)
      • placeTestOrder

        protected void placeTestOrder()
                               throws de.hybris.platform.order.InvalidCartException,
                                      de.hybris.platform.order.exceptions.CalculationException
        Throws:
        de.hybris.platform.order.InvalidCartException
        de.hybris.platform.order.exceptions.CalculationException
      • addReallyBudGuyAndSetAsCurrentUser

        protected void addReallyBudGuyAndSetAsCurrentUser()
      • addNormalUserAndSetAsCurrentUser

        protected void addNormalUserAndSetAsCurrentUser()
      • createCronJob

        protected void createCronJob()
      • before

        public void before()
                    throws java.lang.Exception
        Create core data, add default users, register events, create cron jobs
        Throws:
        java.lang.Exception
      • setupSite

        protected void setupSite()
      • after

        public void after()
        unregister events registered in before(), and revert config parameter values which was changed during test
      • cleanOrder

        protected void cleanOrder()
      • csAgentMarkOrderAsNoFraudulentAndTriggerCleanUpEvent

        protected void csAgentMarkOrderAsNoFraudulentAndTriggerCleanUpEvent()
      • csAgentMarkOrderAsNoFraudulentAndTriggerCSAOrderVerifiedEvent

        protected void csAgentMarkOrderAsNoFraudulentAndTriggerCSAOrderVerifiedEvent()
      • csAgentMarkOrderAsFraudulentAndTriggerCSAOrderVerifiedEvent

        protected void csAgentMarkOrderAsFraudulentAndTriggerCSAOrderVerifiedEvent()
      • getAllPlaceOrderProcessWithCurrentActionWaitForCleanUp

        protected java.util.List<BusinessProcessModel> getAllPlaceOrderProcessWithCurrentActionWaitForCleanUp()
      • getAllPlaceOrderProcessWithCurrentActionWaitForManualOrderCheckCSA

        protected java.util.List<BusinessProcessModel> getAllPlaceOrderProcessWithCurrentActionWaitForManualOrderCheckCSA()
      • getAllPlaceOrderProcessWithSpecificActionName

        protected java.util.List<BusinessProcessModel> getAllPlaceOrderProcessWithSpecificActionName​(java.lang.String processCurrentAction)
      • submitOrderMock

        protected java.lang.String submitOrderMock​(OrderModel order)
      • testUsersOrderIsEvaluatedAsFraudButUserIntervene

        public void testUsersOrderIsEvaluatedAsFraudButUserIntervene()
                                                              throws de.hybris.platform.order.InvalidCartException,
                                                                     de.hybris.platform.order.exceptions.CalculationException
        Test scenario: fraudCheckNode return FRAUD, but customer intervene and csAgent mark order as no fraudulent
        Throws:
        de.hybris.platform.order.exceptions.CalculationException
        de.hybris.platform.order.InvalidCartException
      • testUsersOrderIsEvaluatedAsFraudAndIsCleanedUp

        public void testUsersOrderIsEvaluatedAsFraudAndIsCleanedUp()
                                                            throws de.hybris.platform.order.InvalidCartException,
                                                                   de.hybris.platform.order.exceptions.CalculationException,
                                                                   java.lang.InterruptedException
        Test scenario: fraudCheck node return FRAUD, and after specific period of time order should have status CANCELLED
        Throws:
        de.hybris.platform.order.InvalidCartException
        de.hybris.platform.order.exceptions.CalculationException
        java.lang.InterruptedException
      • testUsersOrderIsEvaluatedAsPotentialFraudButCsAgentDecideThatOrderIsCorrect

        public void testUsersOrderIsEvaluatedAsPotentialFraudButCsAgentDecideThatOrderIsCorrect()
                                                                                         throws de.hybris.platform.order.InvalidCartException,
                                                                                                de.hybris.platform.order.exceptions.CalculationException,
                                                                                                java.lang.InterruptedException
        Test scenario: Users order is evaluated as a potential, but CS Agent decide that order is correct
        Throws:
        de.hybris.platform.order.InvalidCartException
        de.hybris.platform.order.exceptions.CalculationException
        java.lang.InterruptedException
      • testUsersOrderIsEvaluatedAsPotentialFraudAndCsAgentDecideThatOrderIsFraudulent

        public void testUsersOrderIsEvaluatedAsPotentialFraudAndCsAgentDecideThatOrderIsFraudulent()
                                                                                            throws de.hybris.platform.order.InvalidCartException,
                                                                                                   de.hybris.platform.order.exceptions.CalculationException
        Test scenario: TODO
        Throws:
        de.hybris.platform.order.exceptions.CalculationException
        de.hybris.platform.order.InvalidCartException
      • waitToTheEndOfProcess

        protected void waitToTheEndOfProcess​(java.lang.String processCode)