Search in sources :

Example 1 with LegacyProductMixDao

use of org.mifos.accounts.productsmix.persistence.LegacyProductMixDao in project head by mifos.

the class ProductMixBusinessServiceIntegrationTest method testCanProductsExist.

@Test
public void testCanProductsExist() throws Exception {
    LegacyProductMixDao productMixPersistenceMock = createMock(LegacyProductMixDao.class);
    short PRD_OFFERING_ID_ONE = (short) 1;
    short PRD_OFFERING_ID_TWO = (short) 2;
    LoanOfferingBO loanOfferingMock1 = createMock(LoanOfferingBO.class);
    LoanOfferingBO loanOfferingMock2 = createMock(LoanOfferingBO.class);
    expect(productMixPersistenceMock.doesPrdOfferingsCanCoexist(PRD_OFFERING_ID_ONE, PRD_OFFERING_ID_TWO)).andReturn(true);
    expect(loanOfferingMock1.getPrdOfferingId()).andReturn(PRD_OFFERING_ID_ONE);
    expect(loanOfferingMock2.getPrdOfferingId()).andReturn(PRD_OFFERING_ID_TWO);
    replay(loanOfferingMock1, loanOfferingMock2, productMixPersistenceMock);
    new ProductMixBusinessService(productMixPersistenceMock).canProductsCoExist(loanOfferingMock1, loanOfferingMock2);
    verify(loanOfferingMock1, loanOfferingMock2, productMixPersistenceMock);
}
Also used : LegacyProductMixDao(org.mifos.accounts.productsmix.persistence.LegacyProductMixDao) LoanOfferingBO(org.mifos.accounts.productdefinition.business.LoanOfferingBO) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 LoanOfferingBO (org.mifos.accounts.productdefinition.business.LoanOfferingBO)1 LegacyProductMixDao (org.mifos.accounts.productsmix.persistence.LegacyProductMixDao)1