PaymentModulesManagerImpl implements PaymentModulesManager { @Override public Collection<PaymentGatewayDescriptor> getPaymentGatewaysDescriptors(final String paymentModuleLabel) { return paymentModulesMap.get(paymentModuleLabel).getPaymentGateways(); } PaymentModulesManagerImpl(final ServiceLocator serviceLocator,
                                     final SystemService systemService,
                                     final ShopService shopService); @Override Collection<PaymentModule> getPaymentModules(); @Override Collection<PaymentGatewayDescriptor> getPaymentGatewaysDescriptors(final String paymentModuleLabel); @Override void allowPaymentGateway(final String label); @Override void allowPaymentGatewayForShop(final String label, final String shopCode); @Override void disallowPaymentGateway(final String label); @Override void disallowPaymentGatewayForShop(final String label, final String shopCode); @Override List<PaymentGatewayDescriptor> getPaymentGatewaysDescriptors(final boolean includeDisabled, final String shopCode); @Override PaymentGateway getPaymentGateway(final String paymentGatewayLabel, final String shopCode); @Override void register(final PaymentModule paymentModule);  }
@Test public void testGetPaymentGateways() { Collection<PaymentGatewayDescriptor> paymentGateways = paymentModulesManager.getPaymentGatewaysDescriptors("basePaymentModule"); assertEquals(5, paymentGateways.size()); paymentGateways = paymentModulesManager.getPaymentGatewaysDescriptors(true, null); assertEquals(5, paymentGateways.size()); paymentGateways = paymentModulesManager.getPaymentGatewaysDescriptors(true, "DEFAULT"); assertEquals(5, paymentGateways.size()); paymentGateways = paymentModulesManager.getPaymentGatewaysDescriptors(true, "SHOIP1"); assertEquals(5, paymentGateways.size()); paymentGateways = paymentModulesManager.getPaymentGatewaysDescriptors(false, "SHOIP1"); assertEquals(4, paymentGateways.size()); }