Class ApprovedFileInventoryUpdater

java.lang.Object
org.approvej.approve.ApprovedFileInventoryUpdater

@NullMarked public final class ApprovedFileInventoryUpdater extends Object
Records approved file paths during test execution and merges them into the inventory file at JVM shutdown.

This class holds the write buffer for a running test suite. Each byFile() call goes through registerApprovedFile(PathProvider), which accumulates entries in memory. A shutdown hook then loads the existing inventory, merges the new entries, and writes the result back.

This is intentionally separated from ApprovedFileInventory, which operates on a loaded inventory without any static state.

  • Method Details

    • registerApprovedFile

      public static void registerApprovedFile(PathProvider pathProvider)
      Records an approved file path in the inventory.
      Parameters:
      pathProvider - the path provider for the approved file