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 forDefaultPaginatedGenericDao. 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 existingUserGroupModelin junit tenant, existingModelCount is added.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classDefaultPaginatedGenericDaoIntegrationTest.NameComparatorUserGroupModelname attribute comparator usingString.compareTo(String)which handles for null value.classDefaultPaginatedGenericDaoIntegrationTest.UidComparatorUserGroupModeluid attribute comparator usingString.compareTo(String).
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Comparator<UserGroupModel>nameComparatorprotected java.util.Comparator<UserGroupModel>uidComparator-
Fields inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
jaloSession
-
-
Constructor Summary
Constructors Constructor Description DefaultPaginatedGenericDaoIntegrationTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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(java.lang.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()voidshouldSearchAndSortByName()voidshouldSearchAndSortByNameWithUpperCaseName()voidshouldSearchAndSortByUid()voidshouldSearchAndSortByUidWithUpperCaseUid()voidshouldSearchByPagination()voidshouldSearchByPaginationAndSortByNameWithParam()voidshouldSearchByPaginationWithParam()-
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
-
nameComparator
protected java.util.Comparator<UserGroupModel> nameComparator
-
uidComparator
protected java.util.Comparator<UserGroupModel> uidComparator
-
-
Method Detail
-
setUp
public void setUp() throws java.lang.Exception- Throws:
java.lang.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
protected UserGroupModel[] createUserGroupModels(int size)
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
protected UserGroupModel createUserGroup(java.lang.String name)
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
-
-