### Question:
PaymentConfigurationPromotionFilter implements PaymentConfigurationFilter { @Override public boolean isValid(WirecardPaymentConfigurationModel configuration, AbstractOrderModel order) { return restrictionDisabled(configuration) || getWirecardPaymentConfigurationService().hasNoDiscounts(order); }  @Override boolean isValid(WirecardPaymentConfigurationModel configuration, AbstractOrderModel order); @Required void setWirecardPaymentConfigurationService(WirecardPaymentConfigurationService wirecardPaymentConfigurationService);  }### Answer:
@Test public void testIsValid1() { when(configuration.getRestrictPromotions()).thenReturn(false); when(wirecardPaymentConfigurationService.hasNoDiscounts(order)).thenReturn(false); boolean result = paymentConfigurationPromotionFilter.isValid(configuration,order); assertEquals("" + "Is Valid son't work well 1", true, result); }
@Test public void testIsValid2() { when(configuration.getRestrictPromotions()).thenReturn(true); when(wirecardPaymentConfigurationService.hasNoDiscounts(order)).thenReturn(true); boolean result = paymentConfigurationPromotionFilter.isValid(configuration,order); assertEquals("" + "Is Valid son't work well 2", true, result); }