Search in sources :

Example 71 with Ignore

use of org.junit.Ignore in project head by mifos.

the class CollectionSheetDaoHibernateIntegrationTest method testShouldFindAccountCollectionFeesForCustomerAccounts.

@Test
@Ignore
public void testShouldFindAccountCollectionFeesForCustomerAccounts() {
    // setup
    final Short branchId = center.getOffice().getOfficeId();
    final String searchId = center.getSearchId() + ".%";
    final LocalDate transactionDate = new LocalDate();
    // exercise test
    Map<Integer, List<CollectionSheetCustomerAccountCollectionDto>> allCustomerAccountCollectionFees = collectionSheetDao.findAccountCollectionsOnCustomerAccount(branchId, searchId, transactionDate, center.getCustomerId());
    // verification
    Assert.assertNotNull(allCustomerAccountCollectionFees);
    final List<CollectionSheetCustomerAccountCollectionDto> accountCollections = allCustomerAccountCollectionFees.get(group.getCustomerId());
    Assert.assertNotNull(accountCollections);
    Assert.assertThat(accountCollections.size(), is(1));
    Assert.assertThat(accountCollections.get(0).getAccountId(), is(group.getCustomerAccount().getAccountId()));
    Assert.assertThat(accountCollections.get(0).getCustomerId(), is(group.getCustomerId()));
    Assert.assertThat(accountCollections.get(0).getMiscFeesDue(), is(new BigDecimal("0.0000")));
    Assert.assertThat(accountCollections.get(0).getMiscFeesPaid(), is(new BigDecimal("0.0000")));
    Assert.assertThat(accountCollections.get(0).getAccountCollectionPayment(), is(Double.valueOf("0.0")));
}
Also used : CollectionSheetCustomerAccountCollectionDto(org.mifos.application.servicefacade.CollectionSheetCustomerAccountCollectionDto) List(java.util.List) LocalDate(org.joda.time.LocalDate) BigDecimal(java.math.BigDecimal) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 72 with Ignore

use of org.junit.Ignore in project head by mifos.

the class EditStatusActionStrutsTest method updateSuccessForLoan.

@Ignore("Convert to unit test")
public void updateSuccessForLoan() throws Exception {
    request.setAttribute(Constants.CURRENTFLOWKEY, flowKey);
    //        createInitialObjects();
    createCenterGroupClientHierarchy();
    accountBO = getLoanAccount(client, meeting, AccountState.LOAN_ACTIVE_IN_GOOD_STANDING);
    setRequestPathInfo("/editStatusAction.do");
    addRequestParameter("method", "load");
    addRequestParameter("input", "loan");
    addRequestParameter("accountId", accountBO.getAccountId().toString());
    addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
    actionPerform();
    verifyForward("load_success");
    Assert.assertNotNull(SessionUtils.getAttribute(SavingsConstants.STATUS_LIST, request));
    Assert.assertEquals("Size of the status list should be 2", 2, ((List<AccountStateEntity>) SessionUtils.getAttribute(SavingsConstants.STATUS_LIST, request)).size());
    setRequestPathInfo("/editStatusAction.do");
    addRequestParameter("method", "preview");
    addRequestParameter("input", "loan");
    addRequestParameter("notes", "Test");
    addRequestParameter("accountTypeId", accountBO.getType().getValue().toString());
    addRequestParameter("newStatusId", "8");
    addRequestParameter("flagId", "1");
    addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
    actionPerform();
    verifyForward("preview_success");
    StaticHibernateUtil.flushSession();
    setRequestPathInfo("/editStatusAction.do");
    addRequestParameter("method", "update");
    addRequestParameter("notes", "Test");
    addRequestParameter("accountTypeId", accountBO.getType().getValue().toString());
    addRequestParameter("newStatusId", "8");
    addRequestParameter("flagId", "1");
    addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
    actionPerform();
    verifyForward(ActionForwards.loan_detail_page.toString());
    verifyNoActionErrors();
    verifyNoActionMessages();
    accountBO = TestObjectFactory.getObject(AccountBO.class, accountBO.getAccountId());
    List<AuditLog> auditLogList = TestObjectFactory.getChangeLog(EntityType.LOAN, accountBO.getAccountId());
    Assert.assertEquals(1, auditLogList.size());
    Assert.assertEquals(EntityType.LOAN.getValue(), auditLogList.get(0).getEntityType());
    Assert.assertEquals(3, auditLogList.get(0).getAuditLogRecords().size());
    for (AuditLogRecord auditLogRecord : auditLogList.get(0).getAuditLogRecords()) {
        if (auditLogRecord.getFieldName().equalsIgnoreCase("Explanation")) {
            Assert.assertEquals("-", auditLogRecord.getOldValue());
            Assert.assertEquals("Withdraw", auditLogRecord.getNewValue());
        } else if (auditLogRecord.getFieldName().equalsIgnoreCase("Status")) {
            Assert.assertEquals("Active in Good Standing", auditLogRecord.getOldValue());
            Assert.assertEquals("Closed- Rescheduled", auditLogRecord.getNewValue());
        }
    }
}
Also used : AccountBO(org.mifos.accounts.business.AccountBO) AuditLogRecord(org.mifos.framework.components.audit.business.AuditLogRecord) AccountStateEntity(org.mifos.accounts.business.AccountStateEntity) AuditLog(org.mifos.framework.components.audit.business.AuditLog) Ignore(org.junit.Ignore)

Example 73 with Ignore

use of org.junit.Ignore in project head by mifos.

the class LegacyLoanDaoIntegrationTest method testGetTotalOutstandingPrincipalOfLoanAccountsInActiveGoodStandingByBranchId.

@Ignore
@Test
public void testGetTotalOutstandingPrincipalOfLoanAccountsInActiveGoodStandingByBranchId() throws Exception {
    short branchId = 3;
    BigDecimal money = legacyLoanDao.getTotalOutstandingPrincipalOfLoanAccountsInActiveGoodStanding(branchId, (short) -1, (short) -1);
    Assert.assertEquals(0, new BigDecimal(600).compareTo(money));
}
Also used : BigDecimal(java.math.BigDecimal) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 74 with Ignore

use of org.junit.Ignore in project head by mifos.

the class LegacyLoanDaoIntegrationTest method testGetTotalOutstandingPrincipalOfLoanAccountsInActiveGoodStandingByBranchIdAndLoanOfficerId.

@Ignore
@Test
public void testGetTotalOutstandingPrincipalOfLoanAccountsInActiveGoodStandingByBranchIdAndLoanOfficerId() throws Exception {
    short branchId = 3;
    short loanOfficerId = 3;
    BigDecimal money = legacyLoanDao.getTotalOutstandingPrincipalOfLoanAccountsInActiveGoodStanding(branchId, loanOfficerId, (short) -1);
    Assert.assertEquals(0, new BigDecimal(600).compareTo(money));
}
Also used : BigDecimal(java.math.BigDecimal) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 75 with Ignore

use of org.junit.Ignore in project head by mifos.

the class LoanScheduleEntityIntegrationTest method testGetDueAmounts.

@Ignore
@Test
public void testGetDueAmounts() {
    LoanScheduleEntity accountActionDate = (LoanScheduleEntity) groupLoan.getAccountActionDates().toArray()[0];
    accountActionDate.setPrincipalPaid(new Money(getCurrency(), "10.0"));
    accountActionDate.setInterestPaid(new Money(getCurrency(), "2.0"));
    accountActionDate.setPenalty(new Money(getCurrency(), "20.0"));
    accountActionDate.setPenaltyPaid(new Money(getCurrency(), "5.0"));
    accountActionDate.setMiscPenalty(new Money(getCurrency(), "10.0"));
    accountActionDate.setMiscFee(new Money(getCurrency(), "20.0"));
    accountActionDate.setMiscFeePaid(new Money(getCurrency(), "5.0"));
    Assert.assertEquals(TestUtils.createMoney(115.0), accountActionDate.getDueAmnts().getFeesOverdue());
}
Also used : Money(org.mifos.framework.util.helpers.Money) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

Ignore (org.junit.Ignore)5092 Test (org.junit.Test)4807 File (java.io.File)445 ArrayList (java.util.ArrayList)374 IOException (java.io.IOException)217 HashMap (java.util.HashMap)187 List (java.util.List)171 CountDownLatch (java.util.concurrent.CountDownLatch)118 Map (java.util.Map)103 LocalDate (java.time.LocalDate)94 Dataset (org.apache.jena.query.Dataset)93 InputStream (java.io.InputStream)89 Date (java.util.Date)88 Random (java.util.Random)85 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)83 Properties (java.util.Properties)78 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)78 HashSet (java.util.HashSet)71 ByteArrayOutputStream (java.io.ByteArrayOutputStream)70 ExecutorService (java.util.concurrent.ExecutorService)70