Interface SnapshotDirectoryStrategy


  • @API(status=EXPERIMENTAL,
         since="1.7.0")
    public interface SnapshotDirectoryStrategy
    Strategy interface which can be used to determine a custom snapshot directory. Use with SnapshotDirectory.determinedBy().
    Since:
    1.7.0
    • Method Detail

      • determineSnapshotDirectory

        java.nio.file.Path determineSnapshotDirectory​(java.lang.Class<?> testClass,
                                                      SnapshotDirectory directory)
                                               throws SnapshotException
        Determine the directory into which snapshots will be persisted.

        Note that, when returning a path outside src/test/resources, snapshots stored there are currently not subjected to static orphan detection (see DeleteOrphanedSnapshots for details).

        Parameters:
        testClass - The test class for which snapshot tests are enabled.
        directory - The SnapshotDirectory annotation instance.
        Returns:
        The path at which snapshot files will be persisted.
        Throws:
        SnapshotException - Can be thrown by implementors in case determining the directory is not possible.