@IntegrationTest public class DefaultPaginatedGenericDaoIntegrationTest extends ServicelayerBaseTest
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.| Modifier and Type | Class and Description |
|---|---|
class |
DefaultPaginatedGenericDaoIntegrationTest.NameComparator
UserGroupModel name attribute comparator using String.compareTo(String) which handles for null
value. |
class |
DefaultPaginatedGenericDaoIntegrationTest.UidComparator
UserGroupModel uid attribute comparator using String.compareTo(String). |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Comparator<UserGroupModel> |
nameComparator |
protected java.util.Comparator<UserGroupModel> |
uidComparator |
jaloSession| Constructor and Description |
|---|
DefaultPaginatedGenericDaoIntegrationTest() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected UserGroupModel |
createUserGroup(java.lang.String name)
Returns a new
UserGroupModel instance with given name and uid of name connected with current time in
milliseconds. |
protected UserGroupModel[] |
createUserGroupModels(int size)
Returns an
UserGroupModel array of given size with each of UserGroupModel's name of "test_usergroup" +
sequence. |
void |
setUp() |
void |
shouldSearchAndSortByName() |
void |
shouldSearchAndSortByNameWithUpperCaseName() |
void |
shouldSearchAndSortByUid() |
void |
shouldSearchAndSortByUidWithUpperCaseUid() |
void |
shouldSearchByPagination() |
void |
shouldSearchByPaginationAndSortByNameWithParam() |
void |
shouldSearchByPaginationWithParam() |
autowireProperties, getApplicationContext, getBeanName, prepareApplicationContextAndSessionestablishJaloSession, finish, getOrCreateCurrency, getOrCreateLanguage, init, intenseChecksActivated, takeJaloSessionprotected java.util.Comparator<UserGroupModel> nameComparator
protected java.util.Comparator<UserGroupModel> uidComparator
public DefaultPaginatedGenericDaoIntegrationTest()
public void setUp()
throws java.lang.Exception
java.lang.Exceptionpublic void shouldSearchByPagination()
public void shouldSearchAndSortByName()
public void shouldSearchAndSortByNameWithUpperCaseName()
public void shouldSearchAndSortByUid()
public void shouldSearchAndSortByUidWithUpperCaseUid()
public void shouldSearchByPaginationWithParam()
public void shouldSearchByPaginationAndSortByNameWithParam()
protected UserGroupModel[] createUserGroupModels(int size)
UserGroupModel array of given size with each of UserGroupModel's name of "test_usergroup" +
sequence.size - the size of arrayUserGroupModelprotected UserGroupModel createUserGroup(java.lang.String name)
UserGroupModel instance with given name and uid of name connected with current time in
milliseconds.name - the name of the UserGroupModelUserGroupModelprotected void assertPaginationResults(int expectedPaginatedResultSize,
int expectedTotalResultSize,
SearchPageData<UserGroupModel> searchResult)
expectedPaginatedResultSize - the expected result countexpectedTotalResultSize - the expected total results of the search resultssearchResult - the searchResultCopyright © 2018 SAP SE. All Rights Reserved.