@Test
void initializesWithoutTriggeringEvents() {
final Investment i0 = Investment.custom().setDaysPastDue(0).build();
final Investment i1 = Investment.custom().setDaysPastDue(1).build();
final Investment i10 = Investment.custom().setDaysPastDue(10).build();
final Investment i30 = Investment.custom().setDaysPastDue(30).build();
final Investment i60 = Investment.custom().setDaysPastDue(60).build();
final Investment i90 = Investment.custom().setDaysPastDue(90).build();
final Investment defaulted = Investment.custom().setPaymentStatus(PaymentStatus.PAID_OFF).build();
when(zonky.getDelinquentInvestments()).thenReturn(Stream.of(i0, i1, i10, i30, i60, i90, defaulted));
payload.accept(tenant);
assertSoftly(softly -> {
softly.assertThat(r.getCategories(i0)).isEmpty();
softly.assertThat(r.getCategories(i1)).containsExactly(Category.NEW);
softly.assertThat(r.getCategories(i10)).containsExactly(Category.NEW, Category.MILD);
softly.assertThat(r.getCategories(i30)).containsExactly(Category.NEW, Category.MILD, Category.SEVERE);
softly.assertThat(r.getCategories(i60)).containsExactly(Category.NEW, Category.MILD, Category.SEVERE,
Category.CRITICAL);
softly.assertThat(r.getCategories(i90)).containsExactly(Category.NEW, Category.MILD, Category.SEVERE,
Category.CRITICAL, Category.HOPELESS);
softly.assertThat(r.getCategories(defaulted)).containsExactly(Category.NEW, Category.MILD, Category.SEVERE,
Category.CRITICAL, Category.HOPELESS,
Category.DEFAULTED);
softly.assertThat(getEventsRequested()).isEmpty();
});
}