diff --git a/self-core-impl/src/main/java/com/selfxdsd/core/GithubIssueComments.java b/self-core-impl/src/main/java/com/selfxdsd/core/GithubIssueComments.java index d8ca5a48..120336c5 100644 --- a/self-core-impl/src/main/java/com/selfxdsd/core/GithubIssueComments.java +++ b/self-core-impl/src/main/java/com/selfxdsd/core/GithubIssueComments.java @@ -2,6 +2,8 @@ import com.selfxdsd.api.Comment; import com.selfxdsd.api.Comments; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.json.Json; import javax.json.JsonObject; @@ -23,6 +25,13 @@ */ final class GithubIssueComments implements Comments { + /** + * Logger. + */ + private static final Logger LOG = LoggerFactory.getLogger( + GithubIssueComments.class + ); + /** * Base Comments uri. */ @@ -48,12 +57,13 @@ final class GithubIssueComments implements Comments { if(issueUriStr.endsWith("/")){ slash = ""; } - this.commentsUri = URI.create(issueUriStr + slash + "comments/"); + this.commentsUri = URI.create(issueUriStr + slash + "comments"); this.resources = resources; } @Override public Comment post(final String body) { + LOG.debug("Posting Comment to: [" + this.commentsUri + "]."); final Resource resource = resources.post( this.commentsUri, Json.createObjectBuilder().add("body", body).build() @@ -61,6 +71,10 @@ public Comment post(final String body) { if (resource.statusCode() == HttpURLConnection.HTTP_CREATED) { return new GithubComment(resource.asJsonObject()); } else { + LOG.error( + "Expected status 201 CREATED, but got: [" + + resource.statusCode() + "]." + ); throw new IllegalStateException( "Github Issue Comment was not created. Status is " + resource.statusCode()