@Test
public void testToJsonFormatLog() throws Throwable {

  DBAuditMetadataLogEntity amle = new DBAuditMetadataLogEntity("serviceName", "userName",
      "impersonator", "ipAddress", "operation", "eventTime", "operationText", "allowed",
      "objectType", "component", "databaseName", "tableName", "columnName", "resourcePath");
  String jsonAuditLog = amle.toJsonFormatLog();
  ContainerNode rootNode = AuditMetadataLogEntity.parse(jsonAuditLog);
  assertEntryEquals(rootNode, Constants.LOG_FIELD_SERVICE_NAME, "serviceName");
  assertEntryEquals(rootNode, Constants.LOG_FIELD_USER_NAME, "userName");
  assertEntryEquals(rootNode, Constants.LOG_FIELD_IMPERSONATOR,
      "impersonator");
  assertEntryEquals(rootNode, Constants.LOG_FIELD_IP_ADDRESS, "ipAddress");
  assertEntryEquals(rootNode, Constants.LOG_FIELD_OPERATION, "operation");
  assertEntryEquals(rootNode, Constants.LOG_FIELD_EVENT_TIME, "eventTime");
  assertEntryEquals(rootNode, Constants.LOG_FIELD_OPERATION_TEXT,
      "operationText");
  assertEntryEquals(rootNode, Constants.LOG_FIELD_ALLOWED, "allowed");
  assertEntryEquals(rootNode, Constants.LOG_FIELD_DATABASE_NAME,
      "databaseName");
  assertEntryEquals(rootNode, Constants.LOG_FIELD_TABLE_NAME, "tableName");
  assertEntryEquals(rootNode, Constants.LOG_FIELD_COLUMN_NAME, "columnName");
  assertEntryEquals(rootNode, Constants.LOG_FIELD_RESOURCE_PATH,
      "resourcePath");
  assertEntryEquals(rootNode, Constants.LOG_FIELD_OBJECT_TYPE, "objectType");
}