Class DefaultPaginatedGenericDaoIntegrationTest
java.lang.Object
de.hybris.platform.testframework.HybrisJUnit4Test
de.hybris.platform.servicelayer.ServicelayerBaseTest
de.hybris.platform.servicelayer.search.paginated.dao.impl.DefaultPaginatedGenericDaoIntegrationTest
- All Implemented Interfaces:
JaloSessionHolder
@IntegrationTest
public class DefaultPaginatedGenericDaoIntegrationTest
extends ServicelayerBaseTest
Integration test for
DefaultPaginatedGenericDao. It uses testPaginatedUserGroupDao which is specified in
test-core-spring.xml to test its functionality. To verify sorted results, it defined two comparators. To respect
already existing UserGroupModel in junit tenant, existingModelCount is added.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassUserGroupModelname attribute comparator usingString.compareTo(String)which handles for null value.classUserGroupModeluid attribute comparator usingString.compareTo(String). -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Comparator<UserGroupModel>protected Comparator<UserGroupModel>Fields inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
jaloSession -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertPaginationResults(int expectedPaginatedResultSize, int expectedTotalResultSize, SearchPageData<UserGroupModel> searchResult) Asserts the given searchPageData results to see if it has the expected result count based on requested pagination pageSize.protected UserGroupModelcreateUserGroup(String name) Returns a newUserGroupModelinstance with given name and uid of name connected with current time in milliseconds.protected UserGroupModel[]createUserGroupModels(int size) Returns anUserGroupModelarray of given size with each of UserGroupModel's name of "test_usergroup" + sequence.voidsetUp()voidvoidvoidvoidvoidvoidvoidMethods inherited from class de.hybris.platform.servicelayer.ServicelayerBaseTest
autowireProperties, getApplicationContext, getBeanName, prepareApplicationContextAndSessionMethods inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
establishJaloSession, finish, getOrCreateCurrency, getOrCreateLanguage, init, intenseChecksActivated, takeJaloSession
-
Field Details
-
nameComparator
-
uidComparator
-
-
Constructor Details
-
DefaultPaginatedGenericDaoIntegrationTest
public DefaultPaginatedGenericDaoIntegrationTest()
-
-
Method Details
-
setUp
- Throws:
Exception
-
shouldSearchByPagination
public void shouldSearchByPagination() -
shouldSearchAndSortByName
public void shouldSearchAndSortByName() -
shouldSearchAndSortByNameWithUpperCaseName
public void shouldSearchAndSortByNameWithUpperCaseName() -
shouldSearchAndSortByUid
public void shouldSearchAndSortByUid() -
shouldSearchAndSortByUidWithUpperCaseUid
public void shouldSearchAndSortByUidWithUpperCaseUid() -
shouldSearchByPaginationWithParam
public void shouldSearchByPaginationWithParam() -
shouldSearchByPaginationAndSortByNameWithParam
public void shouldSearchByPaginationAndSortByNameWithParam() -
createUserGroupModels
Returns anUserGroupModelarray of given size with each of UserGroupModel's name of "test_usergroup" + sequence.- Parameters:
size- the size of array- Returns:
- Array of
UserGroupModel
-
createUserGroup
Returns a newUserGroupModelinstance with given name and uid of name connected with current time in milliseconds.- Parameters:
name- the name of theUserGroupModel- Returns:
UserGroupModel
-
assertPaginationResults
protected void assertPaginationResults(int expectedPaginatedResultSize, int expectedTotalResultSize, SearchPageData<UserGroupModel> searchResult) Asserts the given searchPageData results to see if it has the expected result count based on requested pagination pageSize. Then also checks for the total results count.- Parameters:
expectedPaginatedResultSize- the expected result countexpectedTotalResultSize- the expected total results of the search resultssearchResult- the searchResult
-