private static ArchiveRetrievalJobRequest buildArchiveRetrievalRequest( String key, GetOptions getOptions) { ArchiveRetrievalJobRequest.Builder requestBuilder = ArchiveRetrievalJobRequest.builder().archiveId(key); if (getOptions != null) { int size = getOptions.getRanges().size(); checkArgument(size <= 1, "The number of ranges should be zero or one"); if (size == 1) { requestBuilder.range(ContentRange.fromString(getOptions.getRanges().get(0))); } } return requestBuilder.build(); }
@Test( groups = {"live", "livelong", "longtest"}, dependsOnMethods = {"testUploadArchive", "testCompleteMultipartUpload"}) public void testInitiateJob() { ArchiveRetrievalJobRequest archiveRetrieval = ArchiveRetrievalJobRequest.builder().archiveId(archiveId).build(); InventoryRetrievalJobRequest inventoryRetrieval = InventoryRetrievalJobRequest.builder().build(); archiveRetrievalJob = api.initiateJob(VAULT_NAME, archiveRetrieval); inventoryRetrievalJob = api.initiateJob(VAULT_NAME, inventoryRetrieval); assertThat(archiveRetrievalJob).isNotNull(); assertThat(inventoryRetrievalJob).isNotNull(); }