public class SegmentEvaluationTest extends BTGIntegrationTest
ALCOHOLS_ONLINE, ALCOHOLS_STAGED, anonymous, AUGISTINER, badTaste, BADTASTE, BEERS_ONLINE, BEERS_STAGED, btgEvaluationService, btgResultService, catalogService, categoryService, conditionEvaluatorRegistry, customerA, customerB, customerC, DRINKS, eur, EUR, EXPENSIVE_100, EXPENSIVE_150, EXPENSIVE_40, EXPENSIVE_60, expressionService, flexibleSearchService, GERMANBEERS_ONLINE, GERMANBEERS_STAGED, goodTaste, GOODTASTE, HACKERPSCHORR, i18nService, KROSTITZER, modelService, NONFULFILLING_PRODUCT_TEMPLATE, online, ONLINE, POLISHBEERS_ONLINE, POLISHBEERS_STAGED, productService, ruleEvaluator, segmentA, segmentACartRule, segmentAOrderRule, segmentB, segmentC, SOFTDRINKS_ONLINE, SOFTDRINKS_STAGED, staged, STAGED, TRADITIONALBEERS, typeService, TYSKIE, usd, USD, USER_A, USER_B, USER_C, userService, WEBSITE_A, WEBSITE_B, WEBSITE_C, websiteA, websiteB, websiteCimportServicedefaultLanguage, jaloSession| Constructor and Description |
|---|
SegmentEvaluationTest() |
| Modifier and Type | Method and Description |
|---|---|
void |
prepareOrders() |
void |
testEvaluationForDifferentCatalog()
Given userA And 15 orders for userA And Sum of last 10 order values >= 1000 And Each order value of last 10 orders
>= 50 And Last 5 order contain a product with code = 'augustinerhelles' And Cart for this user contains product
with code = 'augustinerhelles' Then If all segments are evaluated in scope 'online' for the WebSiteA and the
offline catalog the Segment A is not fulfilled And None of the segment's rules are fulfilled And None of the
rules's conditions are fulfilled And The user doesn't belong to the group "Good Taste"
|
void |
testEvaluationForDifferentWebSite()
Given userA And 15 orders for userA And Sum of last 10 order values >= 1000 And Each order value of last 10 orders
>= 50 And Last 5 order contain a product with code = 'augustinerhelles' And Cart for this user contains product
with code = 'augustinerhelles' Then If all segments are evaluated in scope 'online' for the WebSiteB and the
online catalog the Segment A is not fulfilled And None of the segment's rules are fulfilled And None of the
rules's conditions are fulfilled And The user doesn't belong to the group "Good Taste"
|
void |
testReevaluationOfFulfilledSegment()
Given successful execution of testSuccessfulSegmentEvaluation And Cart for this user still contains product with
code = 'augustinerhelles' And We remove all of the orders of the users Then If all segments are evaluated in scope
'online' for the WebSiteA and the online catalog the Segment A is still fulfilled And All of the segment's rules
are still fulfilled And All of the rules's conditions are still fulfilled And The user still belongs to the group
"Good Taste"
|
void |
testStepByStepSuccessfulSegmentEvaluation()
Step 1:
Given userA And 15 orders for userA And Sum of last 10 order values >= 1000 And Each order value of last 10 orders
>= 50 And Last 5 order contain a product with code = 'augustinerhelles' Then If all segments are evaluated in
scope 'online' for the WebSiteA and the online catalog the Segment A is not fulfilled And All of the segment's
rules are fulfilled except Rule A2 And All of the rules' conditions are fulfilled except the condition for And The
user does not belong to the group "Good Taste"
Step 2:
Given the above scenario And Cart for this user now contains product with code = 'augustinerhelles' Then If all
segments are evaluated in scope 'online' for the WebSiteA and the online catalog the Segment A is fulfilled And
All of the segment's rules are fulfilled And All of the rules's conditions are fulfilled And The user belongs to
the group "Good Taste"
|
void |
testSuccessfulSegmentEvaluation()
Given user A And 15 orders for user A And Sum of last 10 order values >= 1000 And Each order value of last 10
orders >= 50 And Last 5 order contain a product with code = 'augustinerhelles' And Cart for this user contains
product with code = 'augustinerhelles' Then If all segments are evaluated in scope 'online' for the WebSiteA and
the online catalog the Segment A is fulfilled And All of the segment's rules are fulfilled And All of the rules's
conditions are fulfilled And The user belongs to the group "Good Taste"
|
addToCart, addToCartWithCatalog, createBooleanLiteralOperand, createBTGData, createBTGReferenceCategoriesOperand, createBTGReferenceCountriesOperandModel, createCategoriesinOrderOperand, createCustomerCountryOperand, createCustomerGenderOperand, createCustomerPostalCodeOperand, createDoubleLiteralOperand, createExpression, createExpressionInRuleAndSegment, createGenderLiteralOperand, createIntLiteralOperand, createLastOrderDateOperand, createNumberOfOrdersOperand, createOperandModel, createOperator, createOrderOperand, createOrderOperand, createPriceReferenceOperand, createProductsInOrdersOperand, createProductsOperand, createQuantityOfProductInCartOperand, createQuantityOfProductInCartOperand, createReferenceDateOperand, createReferenceExactDateOperand, createRule, createRule, createSegment, createSegment, createSegmentA, createSegmentB, createSegmentC, createStringLiteralOperand, getAttributeDescriptor, getDrinksCatalogVersion, getDrinksOnlineCatalogVersion, placeAdditionalOrders, placeOrdersForSegmentA, placeOrdersForSegmentB, placeOrdersForUserC, placeRandomOrdersNotFulfillingConditions, placeRandomOrdersTotalSum, placeTestOrder, removeUsersOrders, setCatalogVersions, setCurrencies, setCustomersAndUserGroups, setUp, setWebSitescreateCoreData, createDefaultCatalog, createDefaultUsers, createHardwareCatalog, getApplicationContext, importCsv, importData, importData, importData, importStream, importStream, isPrefetchModeNoneautowireProperties, getBeanName, prepareApplicationContextAndSessionestablishJaloSession, finish, getOrCreateCurrency, getOrCreateLanguage, init, intenseChecksActivated, takeJaloSessionpublic void prepareOrders()
throws java.lang.Exception
java.lang.Exceptionpublic void testSuccessfulSegmentEvaluation()
throws java.lang.Exception
java.lang.Exceptionpublic void testStepByStepSuccessfulSegmentEvaluation()
throws java.lang.Exception
java.lang.Exceptionpublic void testEvaluationForDifferentWebSite()
throws java.lang.Exception
java.lang.Exceptionpublic void testEvaluationForDifferentCatalog()
throws java.lang.Exception
java.lang.Exceptionpublic void testReevaluationOfFulfilledSegment()
throws java.lang.Exception
java.lang.ExceptionCopyright © 2018 SAP SE. All Rights Reserved.