HttpRequestFactory { HttpDelete deletePageRequest(String contentId) { assertMandatoryParameter(isNotBlank(contentId), "contentId"); return new HttpDelete(this.confluenceRestApiEndpoint + "/content/" + contentId); } HttpRequestFactory(String rootConfluenceUrl); HttpGet getAttachmentsRequest(String contentId, Integer limit, Integer start, String expandOptions); HttpGet getAttachmentContentRequest(String relativeDownloadLink); HttpGet getPropertyByKeyRequest(String contentId, String key); HttpDelete deletePropertyByKeyRequest(String contentId, String key); HttpPost setPropertyByKeyRequest(String contentId, String key, String value);  }
@Test public void deletePageRequest_withValidParameters_returnsValidHttpDeleteRequest() { String contentId = "1234"; HttpDelete deletePageRequest = this.httpRequestFactory.deletePageRequest(contentId); assertThat(deletePageRequest.getMethod(), is("DELETE")); assertThat(deletePageRequest.getURI().toString(), is(CONFLUENCE_REST_API_ENDPOINT + "/content/" + contentId)); }
@Test public void deletePageRequest_withEmptyContentId_throwsIllegalArgumentException() { this.expectedException.expect(IllegalArgumentException.class); this.expectedException.expectMessage("contentId must be set"); this.httpRequestFactory.deletePageRequest(""); }