DefaultWorldpayBankConfigurationFacade implements WorldpayBankConfigurationFacade { @Override public List<BankConfigurationData> getBankConfigurationForAPMCode(final String apmCode) { final List<WorldpayBankConfigurationModel> activeBankConfigurationsForCode = worldpayBankConfigurationLookupService.getActiveBankConfigurationsForCode(apmCode); return Converters.convertAll(activeBankConfigurationsForCode, bankConfigurationModelBankConfigurationDataConverter); } DefaultWorldpayBankConfigurationFacade(final APMConfigurationLookupService apmConfigurationLookupService,
                                                  final WorldpayBankConfigurationLookupService worldpayBankConfigurationLookupService,
                                                  final Converter<WorldpayBankConfigurationModel, BankConfigurationData> bankConfigurationModelBankConfigurationDataConverter); @Override List<BankConfigurationData> getBankConfigurationForAPMCode(final String apmCode); @Override boolean isBankTransferApm(final String paymentMethod);  }
@Test public void testGetBankConfigurationForAPMCode() { when(converterMock.convert(eq(worldpayBankConfigurationModelMock))).thenReturn(bankConfigurationDataMock); when(worldpayBankConfigurationLookupServiceMock.getActiveBankConfigurationsForCode(APM_CODE)).thenReturn(singletonList(worldpayBankConfigurationModelMock)); final List<BankConfigurationData> bankConfigurationForAPMCode = testObj.getBankConfigurationForAPMCode(APM_CODE); assertTrue(bankConfigurationForAPMCode.contains(bankConfigurationDataMock)); }