Package org.jclouds.glacier.domain

Examples of org.jclouds.glacier.domain.ArchiveRetrievalJobRequest$Builder


      assertThat(archiveId).isNotNull();
   }

   @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();
View Full Code Here


      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);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.glacier.domain.ArchiveRetrievalJobRequest$Builder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.