@Test
public void shouldPublishEvents() throws IOException {

    server.expectRequestTo("http://example.com/event-types/foobar/events", "POST")
            .andExpectJsonPath("$[0].id", equalTo("1"))
            .andExpectJsonPath("$[1].id", equalTo("2"))
            .andRespondWith(200)
            .setup();
    client.publish("foobar", asList(new SomeEvent("1"), new SomeEvent("2")));
}