Class DefaultCascaderTest
- java.lang.Object
-
- de.hybris.platform.testframework.HybrisJUnit4Test
-
- de.hybris.platform.servicelayer.ServicelayerBaseTest
-
- de.hybris.platform.servicelayer.ServicelayerTransactionalBaseTest
-
- de.hybris.platform.servicelayer.internal.model.extractor.impl.DefaultCascaderTest
-
- All Implemented Interfaces:
JaloSessionHolder
public class DefaultCascaderTest extends ServicelayerTransactionalBaseTest
Test class forDefaultCascader
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACTIVE
static java.lang.String
ADDRESSES
static java.lang.String
DEFAULT_PAYMENT_ADDRESS
static java.lang.String
DEFAULT_SHIPMENT_ADDRESS
static java.lang.String
DESCRIPTION
static java.lang.String
ISOCODE
static java.lang.String
KEYWORDS
static java.lang.String
LOGIN_DISABLED
static java.lang.String
PASSWORD_ENCODING
static java.lang.String
REGIONS
static java.lang.String
UID
-
Fields inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
jaloSession
-
-
Constructor Summary
Constructors Constructor Description DefaultCascaderTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setUp()
void
testGetNewModelsForExistingModelAndChangedReferences()
Test method forDefaultCascader.getNewModels(ModelWrapper, InterceptorContextSnapshot, WrapperRegistry)
given argument: one existing (saved) Model holding an updated list of addresses (4 Addresses instead of 3, 1 new Address)
expected result: Only one AddressModel (the new one).void
testGetNewModelsForManyUnsavedModelsWithOneToManyRelation()
Test method forDefaultCascader.getNewModels(ModelWrapper, InterceptorContextSnapshot, WrapperRegistry)
given argument: few unsaved Models (Country with 2 Regions).void
testGetNewModelsForManyUnsavedModelsWithReferences()
Test method forDefaultCascader.getNewModels(ModelWrapper, InterceptorContextSnapshot, WrapperRegistry)
given argument: few unsaved Models (Customer with Collection of 3 Addresses)
expected result: No new models found by Cascadervoid
testGetNewModelsForUnsavedModelWithLocalizedMany2ManyRelation()
Test method forDefaultCascader.getNewModels(ModelWrapper, InterceptorContextSnapshot, WrapperRegistry)
given argument: one unsaved Model - Category, holding 4 localized references (English and German Keywords)
expected result: 4 Keywords (2 EN, 2DE), recognized as new Models by the Cascadervoid
testGetNewModelsForUnsavedModelWithOneToManyRelation()
Test method forDefaultCascader.getNewModels(ModelWrapper, InterceptorContextSnapshot, WrapperRegistry)
given argument: one unsaved Model - Country, holding 2 references (Regions).void
testGetNewModelsForUnsavedModelWithReferences()
Test method forDefaultCascader.getNewModels(ModelWrapper, InterceptorContextSnapshot, WrapperRegistry)
given argument: one unsaved Model (Customer)
expected result: 3 AddressModels recognized as new Model references for the Customer-
Methods inherited from class de.hybris.platform.servicelayer.ServicelayerBaseTest
autowireProperties, getApplicationContext, getBeanName, prepareApplicationContextAndSession
-
Methods inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
establishJaloSession, finish, getOrCreateCurrency, getOrCreateLanguage, init, intenseChecksActivated, takeJaloSession
-
-
-
-
Field Detail
-
UID
public static final java.lang.String UID
- See Also:
- Constant Field Values
-
PASSWORD_ENCODING
public static final java.lang.String PASSWORD_ENCODING
- See Also:
- Constant Field Values
-
LOGIN_DISABLED
public static final java.lang.String LOGIN_DISABLED
- See Also:
- Constant Field Values
-
DESCRIPTION
public static final java.lang.String DESCRIPTION
- See Also:
- Constant Field Values
-
DEFAULT_PAYMENT_ADDRESS
public static final java.lang.String DEFAULT_PAYMENT_ADDRESS
- See Also:
- Constant Field Values
-
DEFAULT_SHIPMENT_ADDRESS
public static final java.lang.String DEFAULT_SHIPMENT_ADDRESS
- See Also:
- Constant Field Values
-
ADDRESSES
public static final java.lang.String ADDRESSES
- See Also:
- Constant Field Values
-
KEYWORDS
public static final java.lang.String KEYWORDS
- See Also:
- Constant Field Values
-
ACTIVE
public static final java.lang.String ACTIVE
- See Also:
- Constant Field Values
-
ISOCODE
public static final java.lang.String ISOCODE
- See Also:
- Constant Field Values
-
REGIONS
public static final java.lang.String REGIONS
- See Also:
- Constant Field Values
-
-
Method Detail
-
setUp
public void setUp() throws java.lang.Exception
- Throws:
java.lang.Exception
-
testGetNewModelsForUnsavedModelWithReferences
public void testGetNewModelsForUnsavedModelWithReferences()
Test method forDefaultCascader.getNewModels(ModelWrapper, InterceptorContextSnapshot, WrapperRegistry)
given argument: one unsaved Model (Customer)
expected result: 3 AddressModels recognized as new Model references for the Customer
-
testGetNewModelsForManyUnsavedModelsWithReferences
public void testGetNewModelsForManyUnsavedModelsWithReferences()
Test method forDefaultCascader.getNewModels(ModelWrapper, InterceptorContextSnapshot, WrapperRegistry)
given argument: few unsaved Models (Customer with Collection of 3 Addresses)
expected result: No new models found by Cascader
-
testGetNewModelsForExistingModelAndChangedReferences
public void testGetNewModelsForExistingModelAndChangedReferences()
Test method forDefaultCascader.getNewModels(ModelWrapper, InterceptorContextSnapshot, WrapperRegistry)
given argument: one existing (saved) Model holding an updated list of addresses (4 Addresses instead of 3, 1 new Address)
expected result: Only one AddressModel (the new one).
-
testGetNewModelsForUnsavedModelWithLocalizedMany2ManyRelation
public void testGetNewModelsForUnsavedModelWithLocalizedMany2ManyRelation()
Test method forDefaultCascader.getNewModels(ModelWrapper, InterceptorContextSnapshot, WrapperRegistry)
given argument: one unsaved Model - Category, holding 4 localized references (English and German Keywords)
expected result: 4 Keywords (2 EN, 2DE), recognized as new Models by the Cascader
-
testGetNewModelsForManyUnsavedModelsWithOneToManyRelation
public void testGetNewModelsForManyUnsavedModelsWithOneToManyRelation()
Test method forDefaultCascader.getNewModels(ModelWrapper, InterceptorContextSnapshot, WrapperRegistry)
given argument: few unsaved Models (Country with 2 Regions). (One to many Relation)
expected result: No new Models found by Cascader
-
testGetNewModelsForUnsavedModelWithOneToManyRelation
public void testGetNewModelsForUnsavedModelWithOneToManyRelation()
Test method forDefaultCascader.getNewModels(ModelWrapper, InterceptorContextSnapshot, WrapperRegistry)
given argument: one unsaved Model - Country, holding 2 references (Regions). (One to many relation)
expected result: 2 Regions, recognized as new by the Cascader.
-
-