CreditCardTransaction { public Integer getInstallmentTerm(int currentPosition) { return cardInstallment.getTermByPosition(currentPosition); } CreditCardTransaction(); void setProperties(CreditCard creditCard, ArrayList<BankBinsResponse> bankBins); boolean isWhiteListBinsAvailable(); boolean isBlackListBinsAvailable(); void setBlackListBinsAvailable(boolean blackListBinsAvailable); boolean isInstallmentAvailable(); boolean isBankBinsAvailable(); void setBankBins(ArrayList<BankBinsResponse> bankBins); boolean isInWhiteList(String cardBin); ArrayList<Integer> getInstallmentTerms(String cardBin); String getBankByBin(String cardBin); String getBankByCardNumber(String cardNumber); boolean isMandiriCardDebit(String cardBin); Integer getInstallmentTerm(int currentPosition); void setInstallment(int termPosition); boolean isInstallmentValid(); void setInstallmentAvailableStatus(boolean installmentStatus); int getInstallmentTermSelected(); String getInstallmentBankSelected(); void setBankPointStatus(boolean bniPointActivated); void setBankPoint(BanksPointResponse response, String bankType); String getBankName(); boolean isBankPointEnabled(); boolean isBankPointValid(); float getBankPointRedeemed(); void setBankPointRedeemed(float pointRedeemed); boolean checkCardBinValidity(String cardNumber); boolean isBlacklistContainCardNumber(String cardNumber); boolean isCardBinBlocked(String cardNumber); void setSelectedPromo(Promo seletedPromo); Promo getSelectedPromo(); boolean isSelectedPromoAvailable(); boolean isInstallmentOptionRequired();  }
@Test public void getInstallmentTerm() throws Exception { initSampleTerms(); when(installment.getTerms()).thenReturn(sampleTerms); when(installment.isRequired()).thenReturn(true); when(card.getInstallment()).thenReturn(installment); cardInstallment.setInstallment(installment); cardTransaction.setProperties(card, readDefaultBankBins()); cardTransaction.getInstallmentTerms(BIN_VALID); int term = cardTransaction.getInstallmentTerm(1); assertEquals(6, term); }