OrderServiceImpl implements OrderService { @Override public boolean addOrder(Order order) { return orderRepository.save(order) != null; }  @Override boolean addOrder(Order order); @Override @Transactional(readOnly = true) List<Order> getOrders();  }
@Test public void testAddOrder() { Order order = new Order(); Mockito.when(orderRepository.save(Matchers.any(Order.class))).thenReturn(order); assertThat(orderService.addOrder(order)).isTrue(); }