@SuppressWarnings({ "rawtypes", "unchecked" })
protected void completeHttpMethodExecution() {
String uri = getLastResponse().getResource();
String query = getLastRequest().getQuery();
if (query != null && !"".equals(query.trim())) {
uri = uri + "?" + query;
}
String clientBaseUri = restClient.getBaseUrl();
String u = clientBaseUri + uri;
CellWrapper uriCell = row.getCell(1);
getFormatter().asLink(uriCell, GLOBALS.substitute(uriCell.body()), u, uri);
CellWrapper cellStatusCode = row.getCell(2);
if (cellStatusCode == null) {
throw new IllegalStateException(
"You must specify a status code cell");
}
Integer lastStatusCode = getLastResponse().getStatusCode();
process(cellStatusCode, lastStatusCode.toString(),
new StatusCodeTypeAdapter());
List<Header> lastHeaders = getLastResponse().getHeaders();
process(row.getCell(3), lastHeaders, new HeadersTypeAdapter());
CellWrapper bodyCell = row.getCell(4);
if (bodyCell == null) {
throw new IllegalStateException("You must specify a body cell");
}
bodyCell.body(GLOBALS.substitute(bodyCell.body()));
BodyTypeAdapter bodyTypeAdapter = createBodyTypeAdapter();
process(bodyCell, getLastResponse().getBody(), bodyTypeAdapter);
}