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);
}
Aggregations