@Test
  public void testBatchCreateScanForm() throws EasyPostException, InterruptedException {
    // create and buy shipments
    Shipment shipment1 = createDefaultShipmentDomestic();
    Shipment shipment2 = createDefaultShipmentDomestic();
    List<String> buyCarriers = new ArrayList<String>();
    buyCarriers.add("USPS");
    shipment1.buy(shipment1.lowestRate(buyCarriers));
    shipment2.buy(shipment2.lowestRate(buyCarriers));

    // create batch and wait until ready
    Batch batch = Batch.create();
    while(true) {
      batch = batch.refresh();
      if ("created".equals(batch.getState())) {
        break;
      }
      Thread.sleep(3000);
    }

    // add shipments to batch
    List<Shipment> shipments = new ArrayList<Shipment>();
    shipments.add(shipment1);
    shipments.add(shipment2);
    batch.addShipments(shipments);

    // create manifest and wait for it to be ready
    batch.createScanForm();
    while(true) {
      batch = batch.refresh();
      if (batch.getScanForm() != null) {
          break;
      }
      Thread.sleep(3000);
    }

    ScanForm scanForm = batch.getScanForm();

    assertNotNull(scanForm);

    assertNotNull(scanForm.getMessage());
    assertNotEquals(scanForm.getLabelUrl(), "");
    assertNotEquals(scanForm.getLabelFileType(), "");
    assertNotNull(scanForm.getBatchId());
  }