Ejemplo n.º 1
0
 @Test
 public void testWrite() throws IOException {
   File jsonFile = new File(mTempFolder.getRoot(), ".kiji-bento-upgrade");
   LOG.info("Creating an UpgradeResponse and writing it.");
   UpgradeResponse.fromJSON(TEST_JSON).write(jsonFile);
   LOG.info("Reading back that file into an UpgradeResponse and verifying.");
   verifyUpgradeResponse(UpgradeResponse.fromFile(jsonFile));
 }
Ejemplo n.º 2
0
  @Test
  public void testFromFile() throws IOException {
    LOG.info("Writing a file with upgrade response JSON.");
    File jsonFile = new File(mTempFolder.getRoot(), ".kiji-bento-upgrade");
    BentoBoxUtils.writeObjectToFile(jsonFile, TEST_JSON);

    LOG.info("Getting and verifying an UpgradeResponse from that file content.");
    UpgradeResponse response = UpgradeResponse.fromFile(jsonFile);
    verifyUpgradeResponse(response);
  }