19202122232425
return new OrderEventHandler(repo); } @Bean public OrdersRepository createRepo() { return new OrdersMemoryRepository(new HashMap<UUID, Order>()); }
18192021222324
OrdersMemoryRepository uut; @Before public void setupUnitUnderTest() { Map<UUID, Order> emptyOrderList = new HashMap<UUID, Order>(); uut = new OrdersMemoryRepository(emptyOrderList); }
3637383940414243444546
@Test public void removeASingleOrder() { UUID key = UUID.randomUUID(); uut = new OrdersMemoryRepository(Collections.singletonMap(key, OrdersFixtures.standardOrder())); assertEquals(1, uut.findAll().size()); uut.delete(key);
20212223242526