mr.addHeader(HttpHeaders.LOCATION, VAULT_LOCATION + "/jobs/" + JOB_ID);
mr.addHeader(GlacierHeaders.JOB_ID, JOB_ID);
server.enqueue(mr);
ContentRange range = ContentRange.fromString("2097152-4194303");
ArchiveRetrievalJobRequest retrieval = ArchiveRetrievalJobRequest.builder()
.archiveId(ARCHIVE_ID)
.description(DESCRIPTION)
.range(range)
.build();
assertThat(client.initiateJob(VAULT_NAME, retrieval)).isEqualTo(JOB_ID);
RecordedRequest request = server.takeRequest();
Json json = new GsonWrapper(new Gson());
ArchiveRetrievalJobRequest job = json.fromJson(new String(request.getBody()), ArchiveRetrievalJobRequest.class);
assertThat(job.getDescription()).isEqualTo(DESCRIPTION);
assertThat(job.getRange()).isEqualTo(range);
assertThat(job.getArchiveId()).isEqualTo(ARCHIVE_ID);
assertThat(job.getType()).isEqualTo("archive-retrieval");
assertEquals(request.getRequestLine(), "POST /-/vaults/" + VAULT_NAME + "/jobs " + HTTP);
}