Added download
This commit is contained in:
@@ -197,4 +197,26 @@ public class CustomerResourceTest extends AbstractRestTest {
|
||||
String expected = fileToString(BASE_DOWNLOAD + "doGetCustomer.json");
|
||||
jsonAssert(expected, text);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@Order(1)
|
||||
public void doDownload() throws IOException {
|
||||
LOG.info("doDownload");
|
||||
|
||||
String authorization = getAuthorization();
|
||||
LOG.info("authorization: " + authorization);
|
||||
String path = deploymentURL + PATH + "/export/1";
|
||||
Request request = Request.Get(path).addHeader("Accept", "application/pdf")
|
||||
.addHeader("Authorization", authorization);
|
||||
|
||||
HttpResponse httpResponse = executeRequest(request);
|
||||
int code = httpResponse.getStatusLine().getStatusCode();
|
||||
assertEquals(200, code);
|
||||
|
||||
|
||||
byte[] text = getResponse(httpResponse);
|
||||
writeFile(text, "doDownload.pdf");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user