CreateSavingsAccountController { public void loadProduct(Integer productId, CreateSavingsAccountFormBean formBean) { SavingsProductReferenceDto product = savingsServiceFacade .retrieveSavingsProductReferenceData(productId); formBean.setProductId(productId); formBean.setProduct(product); formBean.setMandatoryDepositAmount(product.getSavingsProductDetails() .getAmountForDeposit().toString()); formBean.setSavingsTypes(getSavingsTypes()); formBean.setRecurrenceTypes(getRecurrenceTypes()); formBean.setRecurrenceFrequencies(getRecurrenceFrequencies()); } protected  CreateSavingsAccountController(); SavingsAccountDetailDto createAccountInActiveState(
            CreateSavingsAccountFormBean formBean); SavingsAccountDetailDto createAccountInPartialApplicationState(
            CreateSavingsAccountFormBean formBean); SavingsAccountDetailDto createAccountInPendingApprovalState(
            CreateSavingsAccountFormBean formBean); void customerSelected(Integer customerId, CreateSavingsAccountFormBean formBean); void loadQuestionGroups(CreateSavingsAccountFormBean formBean); void loadProduct(Integer productId,
            CreateSavingsAccountFormBean formBean); void getProductOfferings(CreateSavingsAccountFormBean formBean); CustomerSearchResultsDto searchCustomers(
            CreateSavingsAccountFormBean formBean);  }
@SuppressWarnings("unchecked") @Test public void testLoadProduct() { Integer productId = 1; List<ListElement> interestCalculationOptions = new ArrayList<ListElement>(); boolean groupSavingsAccount = false; Integer depositType = 1; Integer groupSavingsType = 1; Double amountForDeposit = 10.0; Double maxWithdrawal = 100.0; BigDecimal interestRate = new BigDecimal("5.0"); Integer interestCalculationType = 1; Integer interestCalculationFrequency = 1; Integer interestCalculationFrequencyPeriod = 1; Integer interestPostingMonthlyFrequency = 1; BigDecimal minBalanceForInterestCalculation = new BigDecimal("1.0"); Integer depositGlCode = 1; Integer interestGlCode = 1; ProductDetailsDto productsDetailDto = null; SavingsProductDto savingsProductDetails = new SavingsProductDto(productsDetailDto, groupSavingsAccount, depositType, groupSavingsType, amountForDeposit, maxWithdrawal, interestRate, interestCalculationType, interestCalculationFrequency, interestCalculationFrequencyPeriod, interestPostingMonthlyFrequency, minBalanceForInterestCalculation, depositGlCode, interestGlCode, false); SavingsProductReferenceDto savingsProductReference = new SavingsProductReferenceDto( interestCalculationOptions, savingsProductDetails, true); when(savingsServiceFacade.retrieveSavingsProductReferenceData(productId)).thenReturn(savingsProductReference); controller.loadProduct(productId, formBean); verify(formBean).setProductId(productId); verify(formBean).setProduct(savingsProductReference); verify(formBean).setMandatoryDepositAmount(any(String.class)); verify(formBean).setSavingsTypes(any(Map.class)); verify(formBean).setRecurrenceTypes(any(Map.class)); verify(formBean).setRecurrenceFrequencies(any(Map.class)); }