@SuppressWarnings("unchecked")
  @Test
  public void getSettledBatchListRequestWithTimeLive() {

    // batch list request
    net.authorize.reporting.Transaction transaction =
        merchant.createReportingTransaction(TransactionType.GET_SETTLED_BATCH_LIST);
    ReportingDetails reportingDetails = ReportingDetails.createReportingDetails();
    Calendar firstSettlementCal = Calendar.getInstance();
    firstSettlementCal.add(Calendar.DAY_OF_YEAR, -30);
    reportingDetails.setBatchFirstSettlementDate(firstSettlementCal.getTime());
    reportingDetails.setBatchLastSettlementDate(Calendar.getInstance().getTime());
    reportingDetails.setBatchIncludeStatistics(true);
    transaction.setReportingDetails(reportingDetails);

    Result<Transaction> result = (Result<Transaction>) merchant.postTransaction(transaction);

    Assert.assertNotNull(result);
    result.printMessages();
    Assert.assertTrue(result.isOk());
    Assert.assertNotNull(result.getReportingDetails().getBatchDetailsList());
    Assert.assertTrue(result.getReportingDetails().getBatchDetailsList().size() > 0);
    for (BatchDetails batchDetail : result.getReportingDetails().getBatchDetailsList()) {
      Assert.assertNotNull(batchDetail.getBatchId());
      Assert.assertNotNull(batchDetail.getSettlementState());
      Assert.assertNotNull(batchDetail.getSettlementTimeLocal());
      Assert.assertNotNull(batchDetail.getSettlementTimeUTC());
      Assert.assertNotNull(batchDetail.getPaymentMethod());
      for (BatchStatistics batchStat : batchDetail.getBatchStatisticsList()) {
        Assert.assertNotNull(batchStat.getAccountType());
        Assert.assertNotNull(batchStat.getChargeAmount());
        Assert.assertNotNull(batchStat.getChargebackAmount());
        Assert.assertNotNull(batchStat.getChargebackCount());
        Assert.assertNotNull(batchStat.getChargeChargebackAmount());
        Assert.assertNotNull(batchStat.getChargeChargebackCount());
        Assert.assertNotNull(batchStat.getChargeCount());
        Assert.assertNotNull(batchStat.getChargeReturnedItemsAmount());
        Assert.assertNotNull(batchStat.getChargeReturnedItemsCount());
        Assert.assertNotNull(batchStat.getCorrectionNoticeCount());
        Assert.assertNotNull(batchStat.getDeclineCount());
        Assert.assertNotNull(batchStat.getErrorCount());
        Assert.assertNotNull(batchStat.getRefundAmount());
        Assert.assertNotNull(batchStat.getRefundChargebackAmount());
        Assert.assertNotNull(batchStat.getRefundCount());
        Assert.assertNotNull(batchStat.getRefundReturnedItemsAmount());
        Assert.assertNotNull(batchStat.getRefundReturnedItemsCount());
        Assert.assertNotNull(batchStat.getReturnedItemAmount());
        Assert.assertNotNull(batchStat.getReturnedItemCount());
        Assert.assertNotNull(batchStat.getVoidCount());
      }
    }
  }