HttpRequestFactory { HttpGet getPageByIdRequest(String contentId, final String expandOptions) { assertMandatoryParameter(isNotBlank(contentId), "contentId"); return new HttpGet(this.confluenceRestApiEndpoint + "/content/" + contentId + "?expand=" + expandOptions); } 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 getPageByIdRequest_withValidParameter_returnsValidHttpGet() { String contentId = "1234"; HttpGet getPageByIdRequest = this.httpRequestFactory.getPageByIdRequest(contentId, "body.storage,version"); assertThat(getPageByIdRequest.getURI().toString(), is(CONFLUENCE_REST_API_ENDPOINT + "/content/" + contentId + "?expand=body.storage,version")); }