@Test public void viewEntityIsWrappedInDisplayableItem() throws Exception { CreditDraft creditDraft = Mockito.mock(CreditDraft.class); InRepaymentCardViewEntity viewEntity = Mockito.mock(InRepaymentCardViewEntity.class); new ArrangeBuilder().withMappedViewEntity(viewEntity); List<DisplayableItem> items = displayableItemMapper.apply(Collections.singletonList(creditDraft)); List<DisplayableItem> expected = Collections.singletonList(DisplayableItem.toDisplayableItem(viewEntity, IN_REPAYMENT)); assertThat(items).isEqualTo(expected); }
@Override public List<DisplayableItem> apply(@NonNull final List<CreditDraft> creditDrafts) throws Exception { return Observable.fromIterable(creditDrafts) .map(inRepaymentCardViewEntityMapper) .map(this::wrapInDisplayableItem) .toList() .blockingGet(); }
CreditDisplayableItemMapper implements Function<List<CreditDraft>, List<DisplayableItem>> { @Override public List<DisplayableItem> apply(@NonNull final List<CreditDraft> creditDrafts) throws Exception { return Observable.fromIterable(creditDrafts) .map(inRepaymentCardViewEntityMapper) .map(this::wrapInDisplayableItem) .toList() .blockingGet(); } }
CreditDisplayableItemMapper implements Function<List<CreditDraft>, List<DisplayableItem>> { @Override public List<DisplayableItem> apply(@NonNull final List<CreditDraft> creditDrafts) throws Exception { return Observable.fromIterable(creditDrafts) .map(inRepaymentCardViewEntityMapper) .map(this::wrapInDisplayableItem) .toList() .blockingGet(); } @Inject  CreditDisplayableItemMapper(@NonNull final InRepaymentCardViewEntityMapper inRepaymentCardViewEntityMapper); }
CreditDisplayableItemMapper implements Function<List<CreditDraft>, List<DisplayableItem>> { @Override public List<DisplayableItem> apply(@NonNull final List<CreditDraft> creditDrafts) throws Exception { return Observable.fromIterable(creditDrafts) .map(inRepaymentCardViewEntityMapper) .map(this::wrapInDisplayableItem) .toList() .blockingGet(); } @Inject  CreditDisplayableItemMapper(@NonNull final InRepaymentCardViewEntityMapper inRepaymentCardViewEntityMapper); @Override List<DisplayableItem> apply(@NonNull final List<CreditDraft> creditDrafts); }
CreditDisplayableItemMapper implements Function<List<CreditDraft>, List<DisplayableItem>> { @Override public List<DisplayableItem> apply(@NonNull final List<CreditDraft> creditDrafts) throws Exception { return Observable.fromIterable(creditDrafts) .map(inRepaymentCardViewEntityMapper) .map(this::wrapInDisplayableItem) .toList() .blockingGet(); } @Inject  CreditDisplayableItemMapper(@NonNull final InRepaymentCardViewEntityMapper inRepaymentCardViewEntityMapper); @Override List<DisplayableItem> apply(@NonNull final List<CreditDraft> creditDrafts);  }