diff --git a/src/test/java/ch/wisv/events/ControllerTest.java b/src/test/java/ch/wisv/events/ControllerTest.java index 504154a0..eeb21742 100644 --- a/src/test/java/ch/wisv/events/ControllerTest.java +++ b/src/test/java/ch/wisv/events/ControllerTest.java @@ -35,6 +35,7 @@ import org.junit.Rule; import org.junit.rules.ExpectedException; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.transaction.annotation.Transactional; @@ -91,6 +92,10 @@ public abstract class ControllerTest { @Autowired protected WebhookTaskRepository webhookTaskRepository; + /** Administration Costs*/ + @Value("${administrationCosts}") + private double administrationCosts; + /** * Other. */ @@ -177,6 +182,9 @@ protected Order createOrder(Customer customer, List products, OrderStat products.forEach(product -> { OrderProduct orderProduct = new OrderProduct(product, product.getCost(), 1L); + if (product.getCost() > 0) { + order.setAdministrationCosts(administrationCosts); + } orderProductRepository.saveAndFlush(orderProduct); order.addOrderProduct(orderProduct); });