fixed after delete tests

This commit is contained in:
Brian Long 2021-01-11 10:51:56 -05:00
parent f5abc63adf
commit cd6f36f41d
2 changed files with 19 additions and 9 deletions

View File

@ -84,15 +84,21 @@ public class ApiGateway {
if (this.logger.isDebugEnabled()) if (this.logger.isDebugEnabled())
this.logger.debug("Received response from " + method + ": " + response.getStatusLine().getStatusCode()); this.logger.debug("Received response from " + method + ": " + response.getStatusLine().getStatusCode());
InputStream istream = response.getEntity().getContent(); Response responseObject = null;
try { if (response.getEntity() != null) {
Response responseObject = this.omapper.readerFor(responseType).readValue(istream); InputStream istream = response.getEntity().getContent();
responseObject.setHttpStatusCode(response.getStatusLine().getStatusCode()); try {
responseObject.setHttpStatusReason(response.getStatusLine().getReasonPhrase()); responseObject = this.omapper.readerFor(responseType).readValue(istream);
return responseObject; } finally {
} finally { istream.close();
istream.close(); }
} else {
responseObject = this.omapper.readerFor(responseType).readValue("{}");
} }
responseObject.setHttpStatusCode(response.getStatusLine().getStatusCode());
responseObject.setHttpStatusReason(response.getStatusLine().getReasonPhrase());
return responseObject;
} }
} }

View File

@ -9,6 +9,10 @@ public class DeleteReference {
return "/repos/" + repoName + "/" + httpPath + "/" + ref; return "/repos/" + repoName + "/" + httpPath + "/" + ref;
} }
public static String httpPath = "git/refs"; public static String constructRequestPathByBranch(String repoName, String branchName) {
return constructRequestPath(repoName, "refs/heads/" + branchName);
}
public static String httpPath = "git";
} }