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())
this.logger.debug("Received response from " + method + ": " + response.getStatusLine().getStatusCode());
InputStream istream = response.getEntity().getContent();
try {
Response responseObject = this.omapper.readerFor(responseType).readValue(istream);
responseObject.setHttpStatusCode(response.getStatusLine().getStatusCode());
responseObject.setHttpStatusReason(response.getStatusLine().getReasonPhrase());
return responseObject;
} finally {
istream.close();
Response responseObject = null;
if (response.getEntity() != null) {
InputStream istream = response.getEntity().getContent();
try {
responseObject = this.omapper.readerFor(responseType).readValue(istream);
} finally {
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;
}
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";
}