@Test public void pendingProviderApprovalStateIsParsedCorrectly() throws Exception { CreditDraftRaw raw = CreditDataTestUtils.creditDraftRawTestBuilder() .status(RawDraftStatus.PENDING_PROVIDER_APPROVAL) .build(); CreditDraft draft = mapper.apply(raw); assertThat(draft.status()).isEqualTo(CreditDraftStatus.PENDING_PROVIDER_APPROVAL); }
@Override @SuppressWarnings("ConstantConditions") public CreditDraft apply(@NonNull final CreditDraftRaw raw) throws Exception { assertEssentialParams(raw); return CreditDraft.builder() .id(raw.id()) .purpose(raw.purposeName()) .amount(raw.amount()) .status(toStatus(raw.status())) .creditRepaymentInfo(mapRepaymentInfo(raw.repaymentInfo())) .imageUrl(raw.imageUrl()) .purposeId(raw.purposeId()) .build(); }
CreditDraftMapper implements Function<CreditDraftRaw, CreditDraft> { @Override @SuppressWarnings("ConstantConditions") public CreditDraft apply(@NonNull final CreditDraftRaw raw) throws Exception { assertEssentialParams(raw); return CreditDraft.builder() .id(raw.id()) .purpose(raw.purposeName()) .amount(raw.amount()) .status(toStatus(raw.status())) .creditRepaymentInfo(mapRepaymentInfo(raw.repaymentInfo())) .imageUrl(raw.imageUrl()) .purposeId(raw.purposeId()) .build(); } }
CreditDraftMapper implements Function<CreditDraftRaw, CreditDraft> { @Override @SuppressWarnings("ConstantConditions") public CreditDraft apply(@NonNull final CreditDraftRaw raw) throws Exception { assertEssentialParams(raw); return CreditDraft.builder() .id(raw.id()) .purpose(raw.purposeName()) .amount(raw.amount()) .status(toStatus(raw.status())) .creditRepaymentInfo(mapRepaymentInfo(raw.repaymentInfo())) .imageUrl(raw.imageUrl()) .purposeId(raw.purposeId()) .build(); } @Inject  CreditDraftMapper(); }
CreditDraftMapper implements Function<CreditDraftRaw, CreditDraft> { @Override @SuppressWarnings("ConstantConditions") public CreditDraft apply(@NonNull final CreditDraftRaw raw) throws Exception { assertEssentialParams(raw); return CreditDraft.builder() .id(raw.id()) .purpose(raw.purposeName()) .amount(raw.amount()) .status(toStatus(raw.status())) .creditRepaymentInfo(mapRepaymentInfo(raw.repaymentInfo())) .imageUrl(raw.imageUrl()) .purposeId(raw.purposeId()) .build(); } @Inject  CreditDraftMapper(); @Override @SuppressWarnings("ConstantConditions") CreditDraft apply(@NonNull final CreditDraftRaw raw); }
CreditDraftMapper implements Function<CreditDraftRaw, CreditDraft> { @Override @SuppressWarnings("ConstantConditions") public CreditDraft apply(@NonNull final CreditDraftRaw raw) throws Exception { assertEssentialParams(raw); return CreditDraft.builder() .id(raw.id()) .purpose(raw.purposeName()) .amount(raw.amount()) .status(toStatus(raw.status())) .creditRepaymentInfo(mapRepaymentInfo(raw.repaymentInfo())) .imageUrl(raw.imageUrl()) .purposeId(raw.purposeId()) .build(); } @Inject  CreditDraftMapper(); @Override @SuppressWarnings("ConstantConditions") CreditDraft apply(@NonNull final CreditDraftRaw raw);  }