LoanImpl extends BaseLoanImpl implements Loan { @Override public String getUrl() { return url; } LoanImpl(); @Override Optional<LoanInvestmentData> getMyInvestment(); void setMyInvestment(final LoanInvestmentDataImpl myInvestment); @Override String getUrl(); void setUrl(final String url); @Override String toString();  }
@Test void deserialize() throws Exception { try (Jsonb jsonb = JsonbBuilder.create()) { Loan loan = jsonb.fromJson(LOAN_JSON, LoanImpl.class); assertSoftly(softly -> { softly.assertThat(loan.getId()) .isEqualTo(710354); softly.assertThat(loan.getUrl()) .isEqualTo("https: softly.assertThat(loan.getName()) .isNotBlank(); softly.assertThat(loan.getStory()) .isNotBlank(); softly.assertThat(loan.getTermInMonths()) .isEqualTo(60); softly.assertThat(loan.getInterestRate()) .isEqualTo(Rating.AAAA.getInterestRate()); softly.assertThat(loan.getAmount()) .isEqualTo(Money.from(360_000)); softly.assertThat(loan.getAnnuity()) .isEqualTo(Money.from(6_921)); softly.assertThat(loan.getAnnuityWithInsurance()) .isEqualTo(Money.from(7_536)); softly.assertThat(loan.getPremium()) .isEqualTo(Money.from(615)); softly.assertThat(loan.getRating()) .isEqualTo(Rating.AAAA); softly.assertThat(loan.getRemainingInvestment()) .isEqualTo(Money.from(318_900)); softly.assertThat(loan.getReservedAmount()) .isEqualTo(Money.from(72_000)); softly.assertThat(loan.getZonkyPlusAmount()) .isEqualTo(Money.from(4_100)); softly.assertThat(loan.getRegion()) .isEqualTo(Region.MORAVSKOSLEZSKY); softly.assertThat(loan.getMainIncomeType()) .isEqualTo(MainIncomeType.EMPLOYMENT); softly.assertThat(loan.isInsuranceActive()) .isTrue(); }); } }