gpt4 book ai didi

com.github.robozonky.common.remote.Zonky.getDevelopments()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 23:51:31 26 4
gpt4 key购买 nike

本文整理了Java中com.github.robozonky.common.remote.Zonky.getDevelopments()方法的一些代码示例,展示了Zonky.getDevelopments()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Zonky.getDevelopments()方法的具体详情如下:
包路径:com.github.robozonky.common.remote.Zonky
类名称:Zonky
方法名:getDevelopments

Zonky.getDevelopments介绍

[英]Retrieve loan collections information via CollectionsApi.
[中]通过CollectionsApi检索贷款托收信息。

代码示例

代码示例来源:origin: com.github.robozonky/robozonky-test

protected static Zonky harmlessZonky(final int availableBalance) {
  final Zonky zonky = mock(Zonky.class);
  final BigDecimal balance = BigDecimal.valueOf(availableBalance);
  when(zonky.getWallet()).thenReturn(new Wallet(1, 2, balance, balance));
  when(zonky.getRestrictions()).thenReturn(new Restrictions(true));
  when(zonky.getBlockedAmounts()).thenAnswer(i -> Stream.empty());
  when(zonky.getStatistics()).thenReturn(Statistics.empty());
  when(zonky.getDevelopments(anyInt())).thenAnswer(i -> Stream.empty());
  return zonky;
}

代码示例来源:origin: RoboZonky/robozonky

protected static Zonky harmlessZonky(final int availableBalance) {
  final Zonky zonky = mock(Zonky.class);
  final BigDecimal balance = BigDecimal.valueOf(availableBalance);
  when(zonky.getWallet()).thenReturn(new Wallet(1, 2, balance, balance));
  when(zonky.getRestrictions()).thenReturn(new Restrictions(true));
  when(zonky.getBlockedAmounts()).thenAnswer(i -> Stream.empty());
  when(zonky.getStatistics()).thenReturn(Statistics.empty());
  when(zonky.getDevelopments(anyInt())).thenAnswer(i -> Stream.empty());
  return zonky;
}

代码示例来源:origin: com.github.robozonky/robozonky-app

private static List<Development> getDevelopments(final Tenant auth, final int loanId,
                         final LocalDate delinquentSince) {
  final LocalDate lastNonDelinquentDay = delinquentSince.minusDays(1);
  final List<Development> developments = auth.call(z -> z.getDevelopments(loanId))
      .filter(d -> d.getDateFrom().toLocalDate().isAfter(lastNonDelinquentDay))
      .collect(toList());
  Collections.reverse(developments);
  return developments;
}

代码示例来源:origin: RoboZonky/robozonky

private static List<Development> getDevelopments(final Tenant auth, final int loanId,
                         final LocalDate delinquentSince) {
  final LocalDate lastNonDelinquentDay = delinquentSince.minusDays(1);
  final List<Development> developments = auth.call(z -> z.getDevelopments(loanId))
      .filter(d -> d.getDateFrom().toLocalDate().isAfter(lastNonDelinquentDay))
      .collect(toList());
  Collections.reverse(developments);
  return developments;
}

代码示例来源:origin: RoboZonky/robozonky

@Test
void processHopeless() {
  final TransactionalPowerTenant transactional = PowerTenant.transactional(mockTenant(zonky));
  System.out.println("Processing.");
  HOPELESS.process(transactional, investment);
  System.out.println("Processed.");
  transactional.commit();
  System.out.println("Committed.");
  assertThat(getEventsRequested()).hasSize(1)
      .first().isInstanceOf(LoanDelinquent90DaysOrMoreEvent.class);
  verify(zonky).getLoan(eq(loan.getId()));
  verify(zonky).getDevelopments(eq(loan.getId()));
}

代码示例来源:origin: RoboZonky/robozonky

@Test
void processMild() {
  final TransactionalPowerTenant transactional = PowerTenant.transactional(mockTenant(zonky));
  MILD.process(transactional, investment);
  transactional.commit();
  assertThat(getEventsRequested()).hasSize(1)
      .first().isInstanceOf(LoanDelinquent10DaysOrMoreEvent.class);
  verify(zonky).getLoan(eq(loan.getId()));
  verify(zonky).getDevelopments(eq(loan.getId()));
}

代码示例来源:origin: RoboZonky/robozonky

@Test
void processSevere() {
  final TransactionalPowerTenant transactional = PowerTenant.transactional(mockTenant(zonky));
  SEVERE.process(transactional, investment);
  transactional.commit();
  assertThat(getEventsRequested()).hasSize(1)
      .first().isInstanceOf(LoanDelinquent30DaysOrMoreEvent.class);
  verify(zonky).getLoan(eq(loan.getId()));
  verify(zonky).getDevelopments(eq(loan.getId()));
}

代码示例来源:origin: RoboZonky/robozonky

@Test
void processCritical() {
  final TransactionalPowerTenant transactional = PowerTenant.transactional(mockTenant(zonky));
  CRITICAL.process(transactional, investment);
  transactional.commit();
  assertThat(getEventsRequested()).hasSize(1)
      .first().isInstanceOf(LoanDelinquent60DaysOrMoreEvent.class);
  verify(zonky).getLoan(eq(loan.getId()));
  verify(zonky).getDevelopments(eq(loan.getId()));
}

代码示例来源:origin: RoboZonky/robozonky

@Test
void processNew() {
  final TransactionalPowerTenant transactional = PowerTenant.transactional(mockTenant(zonky));
  NEW.process(transactional, investment);
  transactional.commit();
  assertThat(getEventsRequested()).hasSize(1)
      .first().isInstanceOf(LoanNowDelinquentEvent.class);
  verify(zonky).getLoan(eq(loan.getId()));
  verify(zonky).getDevelopments(eq(loan.getId()));
}

代码示例来源:origin: RoboZonky/robozonky

@Test
  void processDefaulted() {
    final TransactionalPowerTenant transactional = PowerTenant.transactional(mockTenant(zonky));
    DEFAULTED.process(transactional, investment);
    transactional.commit();
    assertThat(getEventsRequested()).hasSize(1)
        .first().isInstanceOf(LoanDefaultedEvent.class);
    verify(zonky).getLoan(eq(loan.getId()));
    verify(zonky).getDevelopments(eq(loan.getId()));
  }
}

代码示例来源:origin: RoboZonky/robozonky

@Test
void getters() {
  final Zonky z = mockZonky();
  assertSoftly(softly -> {
    softly.assertThat(z.getAvailableLoans(Select.unrestricted())).isEmpty();
    softly.assertThat(z.getBlockedAmounts()).isEmpty();
    softly.assertThat(z.getInvestments(Select.unrestricted())).isEmpty();
    softly.assertThat(z.getInvestment(1)).isEmpty();
    softly.assertThat(z.getDelinquentInvestments()).isEmpty();
    softly.assertThat(z.getAvailableParticipations(Select.unrestricted())).isEmpty();
    softly.assertThat(z.getTransactions(Select.unrestricted())).isEmpty();
    softly.assertThat(z.getDevelopments(1)).isEmpty();
  });
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com