public static AuditManagerS3A createAndStartAuditManager(
      Configuration conf,
      IOStatisticsStore iostatistics) {
    AuditManagerS3A auditManager;
    if (conf.getBoolean(AUDIT_ENABLED, AUDIT_ENABLED_DEFAULT)) {
      auditManager = new ActiveAuditManagerS3A(
          requireNonNull(iostatistics));
    } else {
      LOG.debug("auditing is disabled");
      auditManager = stubAuditManager();
    }
    auditManager.init(conf);
    auditManager.start();
    LOG.debug("Started Audit Manager {}", auditManager);
    return auditManager;
  }
@Test
  public void testLoggingAuditorBinding() throws Throwable {
    AuditManagerS3A manager = AuditIntegration.createAndStartAuditManager(
        AuditTestSupport.loggingAuditConfig(),
        ioStatistics);
    OperationAuditor auditor = manager.getAuditor();
    assertServiceStateStarted(auditor);
    manager.close();
    assertServiceStateStopped(auditor);
  }