@Test public void test() { assertEquals(expected, paymentConfigurationShippingFilter.isValid(configuration, cart)); }
@Override public boolean isValid(WirecardPaymentConfigurationModel configuration, AbstractOrderModel order) { boolean valid = true; if (configuration != null && order != null) { Collection<CountryModel> shippingCountries = configuration.getShippingCountries(); if (CollectionUtils.isNotEmpty(shippingCountries)) { AddressModel deliveryAddress = order.getDeliveryAddress(); if (deliveryAddress != null) { CountryModel country = deliveryAddress.getCountry(); valid = shippingCountries.contains(country); } } } return valid; }
PaymentConfigurationShippingFilter implements PaymentConfigurationFilter { @Override public boolean isValid(WirecardPaymentConfigurationModel configuration, AbstractOrderModel order) { boolean valid = true; if (configuration != null && order != null) { Collection<CountryModel> shippingCountries = configuration.getShippingCountries(); if (CollectionUtils.isNotEmpty(shippingCountries)) { AddressModel deliveryAddress = order.getDeliveryAddress(); if (deliveryAddress != null) { CountryModel country = deliveryAddress.getCountry(); valid = shippingCountries.contains(country); } } } return valid; } }
PaymentConfigurationShippingFilter implements PaymentConfigurationFilter { @Override public boolean isValid(WirecardPaymentConfigurationModel configuration, AbstractOrderModel order) { boolean valid = true; if (configuration != null && order != null) { Collection<CountryModel> shippingCountries = configuration.getShippingCountries(); if (CollectionUtils.isNotEmpty(shippingCountries)) { AddressModel deliveryAddress = order.getDeliveryAddress(); if (deliveryAddress != null) { CountryModel country = deliveryAddress.getCountry(); valid = shippingCountries.contains(country); } } } return valid; }  }
PaymentConfigurationShippingFilter implements PaymentConfigurationFilter { @Override public boolean isValid(WirecardPaymentConfigurationModel configuration, AbstractOrderModel order) { boolean valid = true; if (configuration != null && order != null) { Collection<CountryModel> shippingCountries = configuration.getShippingCountries(); if (CollectionUtils.isNotEmpty(shippingCountries)) { AddressModel deliveryAddress = order.getDeliveryAddress(); if (deliveryAddress != null) { CountryModel country = deliveryAddress.getCountry(); valid = shippingCountries.contains(country); } } } return valid; }  @Override boolean isValid(WirecardPaymentConfigurationModel configuration, AbstractOrderModel order); }
PaymentConfigurationShippingFilter implements PaymentConfigurationFilter { @Override public boolean isValid(WirecardPaymentConfigurationModel configuration, AbstractOrderModel order) { boolean valid = true; if (configuration != null && order != null) { Collection<CountryModel> shippingCountries = configuration.getShippingCountries(); if (CollectionUtils.isNotEmpty(shippingCountries)) { AddressModel deliveryAddress = order.getDeliveryAddress(); if (deliveryAddress != null) { CountryModel country = deliveryAddress.getCountry(); valid = shippingCountries.contains(country); } } } return valid; }  @Override boolean isValid(WirecardPaymentConfigurationModel configuration, AbstractOrderModel order);  }