Exemplo n.º 1
0
 public void extractArchiveWithoutErrors() {
   assertEquals(
       gson.fromJson(
           ""
               + "{\n"
               + "  \"Response Status\": \"201 Created\",\n"
               + "  \"Response Body\": \"\",\n"
               + "  \"Errors\": [],\n"
               + "  \"Number Files Created\": 10\n"
               + "}",
           ExtractArchiveResponse.class),
       ExtractArchiveResponse.create(10, ImmutableMap.<String, String>of()));
 }
Exemplo n.º 2
0
 public void extractArchiveWithErrorsAndDecodesPaths() {
   assertEquals(
       gson.fromJson(
           ""
               + "{\n"
               + "  \"Response Status\": \"201 Created\",\n"
               + "  \"Response Body\": \"\",\n"
               + "  \"Errors\": [\n"
               + "    [\"/v1/12345678912345/mycontainer/home/xx%3Cyy\", \"400 Bad Request\"],\n"
               + "    [\"/v1/12345678912345/mycontainer/../image.gif\", \"400 Bad Request\"]\n"
               + "  ],\n"
               + "  \"Number Files Created\": 8\n"
               + "}",
           ExtractArchiveResponse.class),
       ExtractArchiveResponse.create(
           8,
           ImmutableMap.<String, String>builder()
               .put("/v1/12345678912345/mycontainer/home/xx<yy", "400 Bad Request")
               .put("/v1/12345678912345/mycontainer/../image.gif", "400 Bad Request")
               .build()));
 }