Class PathProviderBuilder

java.lang.Object
org.approvej.approve.PathProviderBuilder

@NullMarked public class PathProviderBuilder extends Object
A builder for creating PathProvider instances.
  • Field Details

    • RECEIVED

      public static final String RECEIVED
      The infix of the file containing the latest received value that didn't match the previously approved.
      See Also:
    • APPROVED

      public static final String APPROVED
      The infix of the file containing a previously approved value.
      See Also:
  • Method Details

    • approvedPath

      public static PathProvider approvedPath(Path approvedPath)
      Creates a new PathProvider that uses the given approved Path.
      Parameters:
      approvedPath - the Path to the approved file
      Returns:
      a new PathProvider
    • approvedPath

      public static PathProvider approvedPath(String approvedPathString)
      Creates a new PathProvider that uses the given approved path}.
      Parameters:
      approvedPathString - the path to the approved file
      Returns:
      a new PathProvider
    • nextToTest

      public static PathProviderBuilder nextToTest()
      Creates a PathProviderBuilder that uses a stack trace to determine the paths of the approved and received files.
      Returns:
      a new PathProviderBuilder
    • nextToTestInSubdirectory

      public static PathProviderBuilder nextToTestInSubdirectory()
      Creates a PathProviderBuilder that uses a stack trace to determine the paths of the approved and received files in a subdirectory named after the currect test class simple name.
      Returns:
      a new PathProviderBuilder
    • directory

      public PathProviderBuilder directory(Path directory)
      Set the directory where the approved and received files are stored.
      Parameters:
      directory - the directory where the approved and received files are stored
      Returns:
      this
    • filenameAffix

      public PathProviderBuilder filenameAffix(String filenameAffix)
      Extends the baseFilename with the given String.
      Parameters:
      filenameAffix - affix to add to the baseFilename
      Returns:
      this
    • filenameExtension

      public PathProvider filenameExtension(String filenameExtension)
      Creates a new PathProvider with the current values and the given filenameExtension.
      Parameters:
      filenameExtension - the filename extension to use
      Returns:
      a new PathProvider with the current values and the given filenameExtension