    @Test
    public void addPageUnderAncestor_withUnsuccessfulResponse_throwsExceptionWithResponseInformation() throws Exception {

        // arrange
        CloseableHttpClient httpClientMock = recordHttpClientForSingleResponseWithContentAndStatusCode("{\"some\": \"json\"}", 404, "reason");
        ConfluenceRestClient confluenceRestClient = new ConfluenceRestClient(CONFLUENCE_ROOT_URL, httpClientMock, null, null, null);

        // assert
        this.expectedException.expect(RequestFailedException.class);
        this.expectedException.expectMessage("request failed (" +
                "request: POST http://confluence.com/rest/api/content " +
                "{\"title\":\"Hello\"," +
                "\"space\":{\"key\":\"~personalSpace\"}," +
                "\"body\":{\"storage\":{\"value\":\"Content\",\"representation\":\"storage\"}}," +
                "\"ancestors\":[{\"id\":\"123\"}]," +
                "\"version\":{\"number\":1,\"message\":\"Version Message\"}," +
                "\"type\":\"page\"}, " +
                "response: 404 reason " +
                "{\"some\": \"json\"}" +
                ")");

        // act
        confluenceRestClient.addPageUnderAncestor("~personalSpace", "123", "Hello", "Content", "Version Message");
    }