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.
  • Field Details

  • Constructor Details

    • DefaultPaginatedGenericDaoIntegrationTest

      public DefaultPaginatedGenericDaoIntegrationTest()
  • Method Details

    • setUp

      public void setUp() throws Exception
      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

      protected UserGroupModel[] createUserGroupModels(int size)
      Returns an UserGroupModel array 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(String name)
      Returns a new UserGroupModel instance with given name and uid of name connected with current time in milliseconds.
      Parameters:
      name - the name of the UserGroupModel
      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 count
      expectedTotalResultSize - the expected total results of the search results
      searchResult - the searchResult