@@ -0,0 +1,1098 @@
+/**%0D%0A * %0D%0A */%0D%0Apackage uk.nhsbsa.gds.hack.service;%0D%0A%0D%0Aimport static org.junit.Assert.*;%0D%0A%0D%0Aimport java.math.BigDecimal;%0D%0Aimport java.math.RoundingMode;%0D%0Aimport java.util.Random;%0D%0A%0D%0Aimport org.junit.Before;%0D%0Aimport org.junit.Test;%0D%0A%0D%0Aimport uk.nhsbsa.gds.hack.model.Order;%0D%0Aimport uk.nhsbsa.gds.hack.model.OrderStatus;%0D%0A%0D%0A/**%0D%0A * @author gary%0D%0A *%0D%0A */%0D%0Apublic class OrderServiceTest %7B%0D%0A%0D%0A%09private OrderService orderService;%0D%0A%09%0D%0A%09private Random random;%0D%0A%09%0D%0A%09@Before%0D%0A%09public void setUp()%0D%0A%09%7B%0D%0A%09%09random = new Random(System.currentTimeMillis());%0D%0A%09%7D%0D%0A%0D%0A%09/**%0D%0A%09 * Test method for %7B@link uk.nhsbsa.gds.hack.service.OrderService#pay(uk.nhsbsa.gds.hack.model.Order)%7D.%0D%0A%09 */%0D%0A%09@Test%0D%0A%09public void testPay() %7B%0D%0A%09%09%0D%0A%09%09Order order = getTestOrder();%0D%0A%09%09%0D%0A%09%09orderService.pay(order);%0D%0A%09%7D%0D%0A%09%0D%0A%09private Order getTestOrder() %7B%0D%0A%09%09Order order = new Order();%0D%0A%09%09%09%0D%0A%09%09order.setCost(new BigDecimal(100).setScale(0, RoundingMode.HALF_UP));%0D%0A%09%09order.setDescription(%22JUnit test case%22);%0D%0A%09%09order.setStatus(OrderStatus.PENDING);%0D%0A%09%09order.setId(Integer.toString(%0D%0A%09%09%09%09random.nextInt(9999))%0D%0A%09%09);%0D%0A%09%09%09%0D%0A%09%09return order;%0D%0A%09%7D%0D%0A%7D%0D%0A

order service happy test