Class DefaultPagedB2BDocumentDaoTest
- java.lang.Object
-
- de.hybris.platform.testframework.HybrisJUnit4Test
-
- de.hybris.platform.servicelayer.ServicelayerBaseTest
-
- de.hybris.platform.servicelayer.ServicelayerTest
-
- de.hybris.platform.servicelayer.ServicelayerTransactionalTest
-
- de.hybris.platform.accountsummaryaddon.B2BIntegrationTest
-
- de.hybris.platform.accountsummaryaddon.document.dao.impl.DefaultPagedB2BDocumentDaoTest
-
- All Implemented Interfaces:
JaloSessionHolder
@IntegrationTest public class DefaultPagedB2BDocumentDaoTest extends B2BIntegrationTest
-
-
Field Summary
Fields Modifier and Type Field Description static java.text.SimpleDateFormat
sdf
-
Fields inherited from class de.hybris.platform.accountsummaryaddon.B2BIntegrationTest
b2bUnitService, baseSiteService, sessionService, userService
-
Fields inherited from class de.hybris.platform.servicelayer.ServicelayerTest
importService
-
Fields inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
jaloSession
-
-
Constructor Summary
Constructors Constructor Description DefaultPagedB2BDocumentDaoTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setUp()
void
shouldGetErrorCriteriaNotFound()
void
shouldGetErrorInvalidPage()
void
shouldNotReturnResult()
void
shouldNotReturnResultFilteredByDocumentType()
This test will return total of 0 result, filtered by documentType "UNKNOWN"void
shouldNotReturnResultForServicesEastFilteredByDocumentType()
This test will return total of 0 result, for unit "Services East" filtered by documentType "UNKNOWN"void
shouldReturnAllDocumentsAscSort()
void
shouldReturnAllDocumentsDescSort()
void
shouldReturnAllPagedDocumentsFilteredByDocumentNumberRange()
This test should return all results including the documents whose documentType.displayInAllList=false.void
shouldReturnAllPagedDocumentsFilteredByDocumentTypeSortedByDefaultSort()
This test should return all results including the documents whose documentType.displayInAllList=false.void
shouldReturnAllPagedDocumentsForProntoGoodsFilteredByDocumentNumberRange()
This test should return only 1 result including the document whose documentType.displayInAllList=false.void
shouldReturnAllPagedDocumentsSortedByDefaultSort()
This test should return all results except the documents whose documentType.displayInAllList=false.void
shouldReturnAllPagedDocumentsSortedByDocumentStatusDesc()
This test returns 5 results as page size is set to 5, sorted byDocumentStatusDesc.void
shouldReturnDocumentAssociateToUser()
void
shouldReturnDocumentsBetweenAmountRange()
void
shouldReturnDocumentsBetweenDateRange()
void
shouldReturnDocumentsBetweenDueDateRange()
void
shouldReturnDocumentsBetweenOpenamountRange()
void
shouldReturnEmptyResultForServicesWestDocuments()
void
shouldReturnNoOpenDocumentsForServicesWest()
This test will return total of 0 results, for unit "Services West" with documentStatus "Open".void
shouldReturnOnlyDocumentsLikeNote()
void
shouldReturnOnlyDocumentsWherePurchaseOrder()
void
shouldReturnOnlyFirstPageSortByDueDate()
void
shouldReturnOnlyFirstPageSortedByDueDateAsc()
This test should return only 2 results as set on pageSize, sorted by "byDueDateAsc".void
shouldReturnOpenDocuments()
void
shouldReturnPagedClosedDocumentsFilteredByDocumentNumberRange()
This test will return total of 1 result, filtered by documentNumber from "CRN-003" to "CRN-006" with documentStatus "Closed".void
shouldReturnPagedClosedDocumentsForCustomRetailFilteredByDocumentNumberRange()
This test will return total of 1 result, for unit "Custom Retail" filtered by documentNumber from "DBN-001" to "DBN-002" with documentStatus "Closed".void
shouldReturnPagedDocumentAssociatedToUserSortedByOpenAmountDesc()
This test will return total of 3 results, sorted by "byOpenAmountDesc" for the user mark.rivers@rustic-hw.com.void
shouldReturnPagedDocumentsForServicesEastFilteredByDocumentNumber()
This test will return total of 3 result, for unit "Services East" filtered by documentNumber with wildcard search on "005".void
shouldReturnPagedDocumentsWithInvoiceForPronto()
This test returns 3 results, for unit "Pronto" sorted byDocumentNumberDesc with documentType "Invoice".void
shouldReturnPagedDocumentsWithPurchaseOrder()
This test returns 1 result, since the test data contains only 1 document with type Purchase Order sorted byDocumentStatusDesc.void
shouldReturnPagedOpenDocumentsFilteredByDateRange()
This test will return total of 2 result, filtered by date from "08/10/2013" to "08/11/2013" with documentStatus "Open", "sorted byDocumentDateAsc".void
shouldReturnPagedOpenDocumentsForAmountRange()
This test will return total of 1 result, filtered by amount from "75.30" to "76.31" with documentStatus "Open".void
shouldReturnPagedOpenDocumentsForCustomRetailFilteredByAmountRange()
This test will return total of 1 result, for unit "Custom Retail" filtered by amount from "24" to "27" with documentStatus "Open".void
shouldReturnPagedOpenDocumentsForCustomRetailFilteredByDateRange()
This test will return total of 1 result, for unit "Custom Retail" filtered by date from "08/09/2013" to "08/11/2013" with documentStatus "Open".void
shouldReturnPagedOpenDocumentsForProntoServicesSortedByCreationDateAsc()
This test will return total of 2 results, for unit "Pronto Services" with documentStatus "Open".void
shouldReturnPagedOpenDocumentsSortedByOpenAmountAsc()
This test will return total of 10 results cause of the page size set to 10, sorted by "byOpenAmountDesc" with documentStatus "Open".void
shouldReturnProntoServicesDocuments()
void
shouldReturnSecondPageSortByAmount()
void
shouldReturnSecondPageSortedByOriginalAmountAsc()
This test will return total of 2 results, sorted by "byOriginalAmountAsc" but on page 1.-
Methods inherited from class de.hybris.platform.accountsummaryaddon.B2BIntegrationTest
createPageableData, login, login
-
Methods inherited from class de.hybris.platform.servicelayer.ServicelayerTest
createCoreData, createDefaultCatalog, createDefaultUsers, createHardwareCatalog, getApplicationContext, importCsv, importData, importData, importData, importStream, importStream, isPrefetchModeNone
-
Methods inherited from class de.hybris.platform.servicelayer.ServicelayerBaseTest
autowireProperties, getBeanName, prepareApplicationContextAndSession
-
Methods inherited from class de.hybris.platform.testframework.HybrisJUnit4Test
establishJaloSession, finish, getOrCreateCurrency, getOrCreateLanguage, init, intenseChecksActivated, takeJaloSession
-
-
-
-
Method Detail
-
setUp
public void setUp() throws java.lang.Exception
- Throws:
java.lang.Exception
-
shouldReturnAllDocumentsAscSort
public void shouldReturnAllDocumentsAscSort()
-
shouldReturnAllDocumentsDescSort
public void shouldReturnAllDocumentsDescSort()
-
shouldReturnOnlyDocumentsWherePurchaseOrder
public void shouldReturnOnlyDocumentsWherePurchaseOrder()
-
shouldReturnOnlyDocumentsLikeNote
public void shouldReturnOnlyDocumentsLikeNote()
-
shouldReturnOnlyFirstPageSortByDueDate
public void shouldReturnOnlyFirstPageSortByDueDate()
-
shouldReturnSecondPageSortByAmount
public void shouldReturnSecondPageSortByAmount()
-
shouldReturnDocumentAssociateToUser
public void shouldReturnDocumentAssociateToUser()
-
shouldReturnOpenDocuments
public void shouldReturnOpenDocuments()
-
shouldReturnProntoServicesDocuments
public void shouldReturnProntoServicesDocuments()
-
shouldReturnEmptyResultForServicesWestDocuments
public void shouldReturnEmptyResultForServicesWestDocuments()
-
shouldReturnDocumentsBetweenAmountRange
public void shouldReturnDocumentsBetweenAmountRange()
-
shouldReturnDocumentsBetweenOpenamountRange
public void shouldReturnDocumentsBetweenOpenamountRange()
-
shouldReturnDocumentsBetweenDateRange
public void shouldReturnDocumentsBetweenDateRange() throws java.text.ParseException
- Throws:
java.text.ParseException
-
shouldReturnDocumentsBetweenDueDateRange
public void shouldReturnDocumentsBetweenDueDateRange() throws java.text.ParseException
- Throws:
java.text.ParseException
-
shouldNotReturnResult
public void shouldNotReturnResult()
-
shouldGetErrorCriteriaNotFound
public void shouldGetErrorCriteriaNotFound()
-
shouldGetErrorInvalidPage
public void shouldGetErrorInvalidPage()
-
shouldReturnAllPagedDocumentsSortedByDefaultSort
public void shouldReturnAllPagedDocumentsSortedByDefaultSort()
This test should return all results except the documents whose documentType.displayInAllList=false. Total documents are 15 in the testB2bdocument.csv, but the search result will only return 14 since, documentType.displayInAllList for Statement is set to false
-
shouldReturnAllPagedDocumentsFilteredByDocumentTypeSortedByDefaultSort
public void shouldReturnAllPagedDocumentsFilteredByDocumentTypeSortedByDefaultSort()
This test should return all results including the documents whose documentType.displayInAllList=false. Total documents are 15 in the testB2bdocument.csv, since the search criteria is documentType, result will return all documents i.e. 15
-
shouldReturnAllPagedDocumentsFilteredByDocumentNumberRange
public void shouldReturnAllPagedDocumentsFilteredByDocumentNumberRange()
This test should return all results including the documents whose documentType.displayInAllList=false. Total documents are 15 in the testB2bdocument.csv, since the search criteria is documentNumber, result will return all documents i.e. 15
-
shouldReturnAllPagedDocumentsForProntoGoodsFilteredByDocumentNumberRange
public void shouldReturnAllPagedDocumentsForProntoGoodsFilteredByDocumentNumberRange()
This test should return only 1 result including the document whose documentType.displayInAllList=false. Since the search criteria is documentNumber From: STA for Unit Pronto Goods, result will return only 1 document
-
shouldReturnAllPagedDocumentsSortedByDocumentStatusDesc
public void shouldReturnAllPagedDocumentsSortedByDocumentStatusDesc()
This test returns 5 results as page size is set to 5, sorted byDocumentStatusDesc.
-
shouldReturnPagedDocumentsWithPurchaseOrder
public void shouldReturnPagedDocumentsWithPurchaseOrder()
This test returns 1 result, since the test data contains only 1 document with type Purchase Order sorted byDocumentStatusDesc.
-
shouldReturnPagedDocumentsWithInvoiceForPronto
public void shouldReturnPagedDocumentsWithInvoiceForPronto()
This test returns 3 results, for unit "Pronto" sorted byDocumentNumberDesc with documentType "Invoice".
-
shouldReturnOnlyFirstPageSortedByDueDateAsc
public void shouldReturnOnlyFirstPageSortedByDueDateAsc()
This test should return only 2 results as set on pageSize, sorted by "byDueDateAsc". It should return documents with number CRN-005 & CRN-006 as the dueDate for these documents is the earliest.
-
shouldReturnSecondPageSortedByOriginalAmountAsc
public void shouldReturnSecondPageSortedByOriginalAmountAsc()
This test will return total of 2 results, sorted by "byOriginalAmountAsc" but on page 1. That's why 3rd & 4th document's amount is compared.
-
shouldReturnPagedDocumentAssociatedToUserSortedByOpenAmountDesc
public void shouldReturnPagedDocumentAssociatedToUserSortedByOpenAmountDesc()
This test will return total of 3 results, sorted by "byOpenAmountDesc" for the user mark.rivers@rustic-hw.com.
-
shouldReturnPagedOpenDocumentsSortedByOpenAmountAsc
public void shouldReturnPagedOpenDocumentsSortedByOpenAmountAsc()
This test will return total of 10 results cause of the page size set to 10, sorted by "byOpenAmountDesc" with documentStatus "Open".
-
shouldReturnPagedOpenDocumentsForProntoServicesSortedByCreationDateAsc
public void shouldReturnPagedOpenDocumentsForProntoServicesSortedByCreationDateAsc()
This test will return total of 2 results, for unit "Pronto Services" with documentStatus "Open".
-
shouldReturnNoOpenDocumentsForServicesWest
public void shouldReturnNoOpenDocumentsForServicesWest()
This test will return total of 0 results, for unit "Services West" with documentStatus "Open". Since the test data does not contain any documents for Services West.
-
shouldReturnPagedOpenDocumentsForAmountRange
public void shouldReturnPagedOpenDocumentsForAmountRange()
This test will return total of 1 result, filtered by amount from "75.30" to "76.31" with documentStatus "Open".
-
shouldReturnPagedOpenDocumentsForCustomRetailFilteredByAmountRange
public void shouldReturnPagedOpenDocumentsForCustomRetailFilteredByAmountRange()
This test will return total of 1 result, for unit "Custom Retail" filtered by amount from "24" to "27" with documentStatus "Open".
-
shouldReturnPagedOpenDocumentsFilteredByDateRange
public void shouldReturnPagedOpenDocumentsFilteredByDateRange() throws java.text.ParseException
This test will return total of 2 result, filtered by date from "08/10/2013" to "08/11/2013" with documentStatus "Open", "sorted byDocumentDateAsc".- Throws:
java.text.ParseException
-
shouldReturnPagedOpenDocumentsForCustomRetailFilteredByDateRange
public void shouldReturnPagedOpenDocumentsForCustomRetailFilteredByDateRange() throws java.text.ParseException
This test will return total of 1 result, for unit "Custom Retail" filtered by date from "08/09/2013" to "08/11/2013" with documentStatus "Open".- Throws:
java.text.ParseException
-
shouldReturnPagedClosedDocumentsFilteredByDocumentNumberRange
public void shouldReturnPagedClosedDocumentsFilteredByDocumentNumberRange()
This test will return total of 1 result, filtered by documentNumber from "CRN-003" to "CRN-006" with documentStatus "Closed".
-
shouldReturnPagedClosedDocumentsForCustomRetailFilteredByDocumentNumberRange
public void shouldReturnPagedClosedDocumentsForCustomRetailFilteredByDocumentNumberRange()
This test will return total of 1 result, for unit "Custom Retail" filtered by documentNumber from "DBN-001" to "DBN-002" with documentStatus "Closed".
-
shouldReturnPagedDocumentsForServicesEastFilteredByDocumentNumber
public void shouldReturnPagedDocumentsForServicesEastFilteredByDocumentNumber()
This test will return total of 3 result, for unit "Services East" filtered by documentNumber with wildcard search on "005".
-
shouldNotReturnResultFilteredByDocumentType
public void shouldNotReturnResultFilteredByDocumentType()
This test will return total of 0 result, filtered by documentType "UNKNOWN"
-
shouldNotReturnResultForServicesEastFilteredByDocumentType
public void shouldNotReturnResultForServicesEastFilteredByDocumentType()
This test will return total of 0 result, for unit "Services East" filtered by documentType "UNKNOWN"
-
-