}
@Test
public void testIdempotentPut()
{
InMemoryEventClient eventClient = new InMemoryEventClient();
PersonStore store = new PersonStore(new StoreConfig(), eventClient);
store.put("foo", createPerson("foo@example.com", "Mr Foo"));
store.put("foo", createPerson("foo@example.com", "Mr Bar"));
assertEquals(createPerson("foo@example.com", "Mr Bar"), store.get("foo"));
assertEquals(store.getAll().size(), 1);
assertEquals(eventClient.getEvents(), ImmutableList.of(
personAdded("foo", createPerson("foo@example.com", "Mr Foo")),
personUpdated("foo", createPerson("foo@example.com", "Mr Bar"))
));
}