Search in sources :

Example 86 with LocalDate

use of org.joda.time.LocalDate in project head by mifos.

the class DailyInterestScheduledEventTest method shouldReturnFirstDateOfPeriodOfMatchingBiDailyDate.

@Test
public void shouldReturnFirstDateOfPeriodOfMatchingBiDailyDate() {
    // setup
    int every = 2;
    dailyEvent = new DailyInterestScheduledEvent(every);
    // exercise test
    LocalDate nextValidMatchingDate = dailyEvent.findFirstDateOfPeriodForMatchingDate(jan2nd);
    assertThat(nextValidMatchingDate, is(jan1st));
}
Also used : LocalDate(org.joda.time.LocalDate) DailyInterestScheduledEvent(org.mifos.accounts.savings.interest.schedule.internal.DailyInterestScheduledEvent) Test(org.junit.Test)

Example 87 with LocalDate

use of org.joda.time.LocalDate in project head by mifos.

the class DailyInterestScheduledEventTest method shouldFindNearestMatchingDateAfterALegalDailyDate.

@Test
public void shouldFindNearestMatchingDateAfterALegalDailyDate() {
    // setup
    int every = 1;
    dailyEvent = new DailyInterestScheduledEvent(every);
    // exercise test
    LocalDate nextMatchingDate = dailyEvent.nextMatchingDateAfter(jan1st, jan2nd);
    assertThat(nextMatchingDate, is(jan3rd));
}
Also used : LocalDate(org.joda.time.LocalDate) DailyInterestScheduledEvent(org.mifos.accounts.savings.interest.schedule.internal.DailyInterestScheduledEvent) Test(org.junit.Test)

Example 88 with LocalDate

use of org.joda.time.LocalDate in project head by mifos.

the class DailyInterestScheduledEventTest method shouldReturnDateOneDayAheadOfJan1st.

@Test
public void shouldReturnDateOneDayAheadOfJan1st() {
    // setup
    int every = 1;
    dailyEvent = new DailyInterestScheduledEvent(every);
    // exercise test
    LocalDate nextValidMatchingDate = dailyEvent.nextMatchingDateFromAlreadyMatchingDate(jan1st);
    assertThat(nextValidMatchingDate, is(jan2nd));
}
Also used : LocalDate(org.joda.time.LocalDate) DailyInterestScheduledEvent(org.mifos.accounts.savings.interest.schedule.internal.DailyInterestScheduledEvent) Test(org.junit.Test)

Example 89 with LocalDate

use of org.joda.time.LocalDate in project head by mifos.

the class DailyInterestScheduledEventTest method shouldReturnAllMatchingBiDailyDatesStartingFromFiscalStartDateUpToCutOffDate.

@Test
public void shouldReturnAllMatchingBiDailyDatesStartingFromFiscalStartDateUpToCutOffDate() {
    // setup
    int every = 2;
    dailyEvent = new DailyInterestScheduledEvent(every);
    // exercise test
    List<LocalDate> nextValidMatchingDate = dailyEvent.findAllMatchingDatesFromBaseDateUpToAndIncludingNearestMatchingEndDate(startOfFiscalYear, cutOffDate);
    assertThat(nextValidMatchingDate, hasItem(jan2nd));
    assertThat(nextValidMatchingDate, hasItem(jan4th));
    assertThat(nextValidMatchingDate, not(hasItem(jan1st)));
    assertThat(nextValidMatchingDate, not(hasItem(jan3rd)));
}
Also used : LocalDate(org.joda.time.LocalDate) DailyInterestScheduledEvent(org.mifos.accounts.savings.interest.schedule.internal.DailyInterestScheduledEvent) Test(org.junit.Test)

Example 90 with LocalDate

use of org.joda.time.LocalDate in project head by mifos.

the class DailyInterestScheduledEventTest method shouldReturnAllMatchingDailyDatesStartingFromFiscalStartDateUpToCutOffDate.

@Test
public void shouldReturnAllMatchingDailyDatesStartingFromFiscalStartDateUpToCutOffDate() {
    // setup
    int every = 1;
    dailyEvent = new DailyInterestScheduledEvent(every);
    // exercise test
    List<LocalDate> nextValidMatchingDate = dailyEvent.findAllMatchingDatesFromBaseDateUpToAndIncludingNearestMatchingEndDate(startOfFiscalYear, cutOffDate);
    assertThat(nextValidMatchingDate, hasItem(jan1st));
    assertThat(nextValidMatchingDate, hasItem(jan2nd));
    assertThat(nextValidMatchingDate, hasItem(jan3rd));
    assertThat(nextValidMatchingDate, hasItem(dec31st));
}
Also used : LocalDate(org.joda.time.LocalDate) DailyInterestScheduledEvent(org.mifos.accounts.savings.interest.schedule.internal.DailyInterestScheduledEvent) Test(org.junit.Test)

Aggregations

LocalDate (org.joda.time.LocalDate)1094 Test (org.testng.annotations.Test)553 BigDecimal (java.math.BigDecimal)401 DateTime (org.joda.time.DateTime)231 ArrayList (java.util.ArrayList)217 Test (org.junit.Test)187 Invoice (org.killbill.billing.invoice.api.Invoice)165 UUID (java.util.UUID)148 Account (org.killbill.billing.account.api.Account)139 InvoiceItem (org.killbill.billing.invoice.api.InvoiceItem)118 DefaultEntitlement (org.killbill.billing.entitlement.api.DefaultEntitlement)104 FixedPriceInvoiceItem (org.killbill.billing.invoice.model.FixedPriceInvoiceItem)101 RecurringInvoiceItem (org.killbill.billing.invoice.model.RecurringInvoiceItem)95 ExpectedInvoiceItemCheck (org.killbill.billing.beatrix.util.InvoiceChecker.ExpectedInvoiceItemCheck)85 DefaultInvoice (org.killbill.billing.invoice.model.DefaultInvoice)82 RepairAdjInvoiceItem (org.killbill.billing.invoice.model.RepairAdjInvoiceItem)71 ItemAdjInvoiceItem (org.killbill.billing.invoice.model.ItemAdjInvoiceItem)69 PlanPhaseSpecifier (org.killbill.billing.catalog.api.PlanPhaseSpecifier)63 Date (java.util.Date)57 MockPlan (org.killbill.billing.catalog.MockPlan)52