@Test public void addPageUnderAncestorRequest_withoutAncestorId_throwsIllegalArgumentException() { this.expectedException.expect(IllegalArgumentException.class); this.expectedException.expectMessage("ancestorId must be set"); this.httpRequestFactory.addPageUnderAncestorRequest("~personalSpace", "", "title", "content", "version message"); }
HttpPost addPageUnderAncestorRequest(String spaceKey, String ancestorId, String title, String content, String versionMessage) { assertMandatoryParameter(isNotBlank(spaceKey), "spaceKey"); assertMandatoryParameter(isNotBlank(ancestorId), "ancestorId"); assertMandatoryParameter(isNotBlank(title), "title"); PagePayload pagePayload = pagePayloadBuilder() .spaceKey(spaceKey) .ancestorId(ancestorId) .title(title) .content(content) .version(INITAL_VERSION) .versionMessage(versionMessage) .build(); return addPageHttpPost(this.confluenceRestApiEndpoint, pagePayload); }
HttpRequestFactory { HttpPost addPageUnderAncestorRequest(String spaceKey, String ancestorId, String title, String content, String versionMessage) { assertMandatoryParameter(isNotBlank(spaceKey), "spaceKey"); assertMandatoryParameter(isNotBlank(ancestorId), "ancestorId"); assertMandatoryParameter(isNotBlank(title), "title"); PagePayload pagePayload = pagePayloadBuilder() .spaceKey(spaceKey) .ancestorId(ancestorId) .title(title) .content(content) .version(INITAL_VERSION) .versionMessage(versionMessage) .build(); return addPageHttpPost(this.confluenceRestApiEndpoint, pagePayload); } }
HttpRequestFactory { HttpPost addPageUnderAncestorRequest(String spaceKey, String ancestorId, String title, String content, String versionMessage) { assertMandatoryParameter(isNotBlank(spaceKey), "spaceKey"); assertMandatoryParameter(isNotBlank(ancestorId), "ancestorId"); assertMandatoryParameter(isNotBlank(title), "title"); PagePayload pagePayload = pagePayloadBuilder() .spaceKey(spaceKey) .ancestorId(ancestorId) .title(title) .content(content) .version(INITAL_VERSION) .versionMessage(versionMessage) .build(); return addPageHttpPost(this.confluenceRestApiEndpoint, pagePayload); } HttpRequestFactory(String rootConfluenceUrl); }
HttpRequestFactory { HttpPost addPageUnderAncestorRequest(String spaceKey, String ancestorId, String title, String content, String versionMessage) { assertMandatoryParameter(isNotBlank(spaceKey), "spaceKey"); assertMandatoryParameter(isNotBlank(ancestorId), "ancestorId"); assertMandatoryParameter(isNotBlank(title), "title"); PagePayload pagePayload = pagePayloadBuilder() .spaceKey(spaceKey) .ancestorId(ancestorId) .title(title) .content(content) .version(INITAL_VERSION) .versionMessage(versionMessage) .build(); return addPageHttpPost(this.confluenceRestApiEndpoint, pagePayload); } 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); }
HttpRequestFactory { HttpPost addPageUnderAncestorRequest(String spaceKey, String ancestorId, String title, String content, String versionMessage) { assertMandatoryParameter(isNotBlank(spaceKey), "spaceKey"); assertMandatoryParameter(isNotBlank(ancestorId), "ancestorId"); assertMandatoryParameter(isNotBlank(title), "title"); PagePayload pagePayload = pagePayloadBuilder() .spaceKey(spaceKey) .ancestorId(ancestorId) .title(title) .content(content) .version(INITAL_VERSION) .versionMessage(versionMessage) .build(); return addPageHttpPost(this.confluenceRestApiEndpoint, pagePayload); } 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);  }