@Test
public void shouldHandleMultiStatusWhenPublishing() throws IOException {

    server.expectRequestTo("http://example.com/event-types/foobar/events", "POST")
            .andExpectJsonPath("$[0].id", equalTo("1"))
            .andExpectJsonPath("$[1].id", equalTo("2"))
            .andRespondWith(207, ContentType.APPLICATION_JSON, "[{\"publishing_status\":\"failed\",\"step\":\"validating\",\"detail\":\"baz\"}]")
            .setup();
    expectedException.expect(EventPublishingException.class);
    expectedException.expectMessage("returned status [failed] in step [validating] with detail [baz]");
    client.publish("foobar", asList(new SomeEvent("1"), new SomeEvent("2")));
    server.verify();
}